git-svn-id: https://svn.eduke32.com/eduke32@343 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2006-11-17 08:22:52 +00:00
parent 3413ff8dd9
commit 453c1f9649
2 changed files with 8 additions and 24 deletions

View file

@ -1417,24 +1417,8 @@ int handleevents(void)
case SDL_MOUSEMOTION: case SDL_MOUSEMOTION:
if (appactive) if (appactive)
{ {
static int relx = 0;
static int rely = 0;
if (SDL_PeepEvents(NULL, 1, SDL_PEEKEVENT, SDL_MOUSEMOTIONMASK))
{
/* ignore the current event, a newer one is waiting */
relx += ev.motion.xrel;
rely += ev.motion.yrel;
}
else
{
ev.motion.xrel += relx;
ev.motion.yrel += rely;
mousex += ev.motion.xrel; mousex += ev.motion.xrel;
mousey += ev.motion.yrel; mousey += ev.motion.yrel;
relx = 0;
rely = 0;
}
} }
break; break;

View file

@ -8234,7 +8234,7 @@ int load_rancid_net(char *fn)
char *ip; char *ip;
if (scriptfile_getstring(script,&ip)) break; if (scriptfile_getstring(script,&ip)) break;
Bstrcpy(rancid_ip_strings[MAXPLAYERS],ip); Bstrcpy(rancid_ip_strings[MAXPLAYERS-1],ip);
Bstrcpy(rancid_ip_strings[rancid_players++],ip); Bstrcpy(rancid_ip_strings[rancid_players++],ip);
strtok(ip,":"); strtok(ip,":");
Bsprintf(tempbuf,"%s",strtok(NULL,":")); Bsprintf(tempbuf,"%s",strtok(NULL,":"));
@ -8416,7 +8416,7 @@ void checkcommandline(int argc,char **argv)
{ {
for (j=0;j<rancid_players;j++) for (j=0;j<rancid_players;j++)
{ {
if (Bstrcmp(rancid_ip_strings[j],rancid_ip_strings[MAXPLAYERS]) != 0) if (Bstrcmp(rancid_ip_strings[j],rancid_ip_strings[MAXPLAYERS-1]) != 0)
{ {
Bstrncpy(tempbuf,rancid_ip_strings[j], 8); Bstrncpy(tempbuf,rancid_ip_strings[j], 8);
Bstrcpy(tmp,strtok(tempbuf,".")); Bstrcpy(tmp,strtok(tempbuf,"."));
@ -8455,7 +8455,7 @@ void checkcommandline(int argc,char **argv)
} }
} }
Bstrcpy(tempbuf,rancid_ip_strings[MAXPLAYERS]); Bstrcpy(tempbuf,rancid_ip_strings[MAXPLAYERS-1]);
Bstrcpy(tmp,strtok(tempbuf,".")); Bstrcpy(tmp,strtok(tempbuf,"."));
if (j == rancid_players && ((Bstrcmp(tmp,"192") == 0) || (Bstrcmp(tmp,"172") == 0) || (Bstrcmp(tmp,"169") == 0) || (Bstrcmp(tmp,"10") == 0))) if (j == rancid_players && ((Bstrcmp(tmp,"192") == 0) || (Bstrcmp(tmp,"172") == 0) || (Bstrcmp(tmp,"169") == 0) || (Bstrcmp(tmp,"10") == 0)))
{ {
@ -8464,9 +8464,9 @@ void checkcommandline(int argc,char **argv)
{ {
for (j=0;j<rancid_players;j++) for (j=0;j<rancid_players;j++)
{ {
if (Bstrcmp(rancid_ip_strings[j],rancid_ip_strings[MAXPLAYERS]) == 0) if (Bstrcmp(rancid_ip_strings[j],rancid_ip_strings[MAXPLAYERS-1]) == 0)
{ {
Bstrcpy(rancid_ip_strings[MAXPLAYERS],tempbuf); Bstrcpy(rancid_ip_strings[MAXPLAYERS-1],tempbuf);
Bstrcpy(rancid_ip_strings[j],tempbuf); Bstrcpy(rancid_ip_strings[j],tempbuf);
} }
} }
@ -8482,7 +8482,7 @@ void checkcommandline(int argc,char **argv)
for (j=0;j<rancid_players;j++) for (j=0;j<rancid_players;j++)
{ {
if (Bstrcmp(rancid_ip_strings[j],rancid_ip_strings[MAXPLAYERS]) == 0) if (Bstrcmp(rancid_ip_strings[j],rancid_ip_strings[MAXPLAYERS-1]) == 0)
Bsprintf(rancid_ip_strings[j],"/n1"); Bsprintf(rancid_ip_strings[j],"/n1");
netparam[j] = (char *)&rancid_ip_strings[j]; netparam[j] = (char *)&rancid_ip_strings[j];
} }
@ -9273,9 +9273,9 @@ void Startup(void)
for (i=0;i<MAXPLAYERS;i++) playerreadyflag[i] = 0; for (i=0;i<MAXPLAYERS;i++) playerreadyflag[i] = 0;
if (Bstrlen(rancid_ip_strings[MAXPLAYERS])) if (Bstrlen(rancid_ip_strings[MAXPLAYERS-1]))
{ {
initprintf("rmnet: Using %s as sort IP\n",rancid_ip_strings[MAXPLAYERS]); initprintf("rmnet: Using %s as sort IP\n",rancid_ip_strings[MAXPLAYERS-1]);
initprintf("rmnet: %d players\n",rancid_players); initprintf("rmnet: %d players\n",rancid_players);
} }