Skip to content

Commit

Permalink
Simpler method
Browse files Browse the repository at this point in the history
  • Loading branch information
darkshade9 committed Sep 30, 2024
1 parent 8eea98d commit 5fd9176
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 0 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,6 @@ if get_option('aqtion-build')
dll_link_args += '-lws2_32'
dll_link_args += '-lcrypt32'
dll_link_args += '-lwsock32'
botlib_src += 'src/action/botlib/botlib_win.c'
endif
endif

Expand Down
10 changes: 10 additions & 0 deletions src/action/botlib/botlib_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,28 @@

#ifndef _WIN32
#include <sys/time.h>
#else
#define WIN32_LEAN_AND_MEAN
#include <time.h>
#endif

/*
This file is for common utilities that are used by the botlib functions
*/

#ifndef _WIN32
void seed_random_number_generator(void) {
struct timeval tv;
gettimeofday(&tv, NULL);
srand(tv.tv_usec * tv.tv_sec);
}
#else
void seed_random_number_generator(void) {
srand((unsigned int)time(NULL));
}
#endif


void BOTLIB_SKILL_Init(edict_t* bot)
{
// Initialize random skill levels
Expand Down

0 comments on commit 5fd9176

Please sign in to comment.