Skip to content

Commit

Permalink
Done with the windows nonsense, just renaming the vars
Browse files Browse the repository at this point in the history
  • Loading branch information
darkshade9 committed Sep 30, 2024
1 parent 5fd9176 commit a068d17
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
16 changes: 8 additions & 8 deletions src/action/botlib/botlib_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,26 @@
#include "../acesrc/acebot.h"
#include "botlib.h"

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

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

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

Expand Down
18 changes: 9 additions & 9 deletions src/action/g_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -1185,8 +1185,8 @@ static void Cmd_Players_f (edict_t * ent)
{
int i;
int count = 0;
char small[64];
char large[1024];
char _small[64];
char _large[1024];
gclient_t *sortedClients[MAX_CLIENTS], *cl;

if (!teamplay->value || !noscore->value)
Expand All @@ -1195,28 +1195,28 @@ static void Cmd_Players_f (edict_t * ent)
count = G_NotSortedClients( sortedClients );

// print information
large[0] = 0;
_large[0] = 0;

for (i = 0; i < count; i++)
{
cl = sortedClients[i];
if (!teamplay->value || !noscore->value)
Q_snprintf (small, sizeof (small), "%3i %s\n",
Q_snprintf (_small, sizeof (_small), "%3i %s\n",
cl->ps.stats[STAT_FRAGS],
cl->pers.netname );
else
Q_snprintf (small, sizeof (small), "%s\n",
Q_snprintf (_small, sizeof (_small), "%s\n",
cl->pers.netname);

if (strlen(small) + strlen(large) > sizeof (large) - 20)
if (strlen(_small) + strlen(_large) > sizeof (_large) - 20)
{ // can't print all of them in one packet
strcat (large, "...\n");
strcat (_large, "...\n");
break;
}
strcat (large, small);
strcat (_large, _small);
}

gi.cprintf(ent, PRINT_HIGH, "%s\n%i players\n", large, count);
gi.cprintf(ent, PRINT_HIGH, "%s\n%i players\n", _large, count);
}

/*
Expand Down

0 comments on commit a068d17

Please sign in to comment.