From 19c34b09effa0f5758a9c709b37d23284b0d5a7e Mon Sep 17 00:00:00 2001 From: terminx Date: Mon, 27 Aug 2007 06:46:31 +0000 Subject: [PATCH] dynamically allocated player structs git-svn-id: https://svn.eduke32.com/eduke32@564 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/actors.c | 722 +++++++-------- polymer/eduke32/source/anim.c | 4 +- polymer/eduke32/source/config.c | 10 +- polymer/eduke32/source/duke3d.h | 15 +- polymer/eduke32/source/game.c | 1077 ++++++++++++----------- polymer/eduke32/source/gamedef.c | 28 +- polymer/eduke32/source/gameexec.c | 986 ++++++++++----------- polymer/eduke32/source/global.c | 3 +- polymer/eduke32/source/jfaud_sounds.cpp | 22 +- polymer/eduke32/source/menus.c | 130 +-- polymer/eduke32/source/osdcmds.c | 92 +- polymer/eduke32/source/player.c | 478 +++++----- polymer/eduke32/source/premap.c | 273 +++--- polymer/eduke32/source/savegame.c | 46 +- polymer/eduke32/source/sector.c | 194 ++-- polymer/eduke32/source/sounds.c | 32 +- polymer/eduke32/source/startgtk.game.c | 2 +- 17 files changed, 2078 insertions(+), 2036 deletions(-) diff --git a/polymer/eduke32/source/actors.c b/polymer/eduke32/source/actors.c index ad1c84617..d9eb652d3 100644 --- a/polymer/eduke32/source/actors.c +++ b/polymer/eduke32/source/actors.c @@ -429,15 +429,15 @@ SKIPWALLCHECK: if (sj->picnum == APLAYER) { p = sj->yvel; - if (g_player[p].ps.newowner >= 0) + if (g_player[p].ps->newowner >= 0) { - g_player[p].ps.newowner = -1; - g_player[p].ps.posx = g_player[p].ps.oposx; - g_player[p].ps.posy = g_player[p].ps.oposy; - g_player[p].ps.posz = g_player[p].ps.oposz; - g_player[p].ps.ang = g_player[p].ps.oang; - updatesector(g_player[p].ps.posx,g_player[p].ps.posy,&g_player[p].ps.cursectnum); - setpal(&g_player[p].ps); + g_player[p].ps->newowner = -1; + g_player[p].ps->posx = g_player[p].ps->oposx; + g_player[p].ps->posy = g_player[p].ps->oposy; + g_player[p].ps->posz = g_player[p].ps->oposz; + g_player[p].ps->ang = g_player[p].ps->oang; + updatesector(g_player[p].ps->posx,g_player[p].ps->posy,&g_player[p].ps->cursectnum); + setpal(g_player[p].ps); k = headspritestat[1]; while (k >= 0) @@ -743,7 +743,7 @@ static void movefta(void) ssect = psect = s->sectnum; - if (sprite[g_player[p].ps.i].extra > 0) + if (sprite[g_player[p].ps->i].extra > 0) { if (x < 30000) { @@ -752,8 +752,8 @@ static void movefta(void) { if (badguy(s)) { - px = g_player[p].ps.oposx+64-(TRAND&127); - py = g_player[p].ps.oposy+64-(TRAND&127); + px = g_player[p].ps->oposx+64-(TRAND&127); + py = g_player[p].ps->oposy+64-(TRAND&127); updatesector(px,py,&psect); if (psect == -1) { @@ -768,10 +768,10 @@ static void movefta(void) i = nexti; continue; } - j = cansee(sx,sy,s->z-(TRAND%(52<<8)),s->sectnum,px,py,g_player[p].ps.oposz-(TRAND%(32<<8)),g_player[p].ps.cursectnum); + j = cansee(sx,sy,s->z-(TRAND%(52<<8)),s->sectnum,px,py,g_player[p].ps->oposz-(TRAND%(32<<8)),g_player[p].ps->cursectnum); } else - j = cansee(s->x,s->y,s->z-((TRAND&31)<<8),s->sectnum,g_player[p].ps.oposx,g_player[p].ps.oposy,g_player[p].ps.oposz-((TRAND&31)<<8),g_player[p].ps.cursectnum); + j = cansee(s->x,s->y,s->z-((TRAND&31)<<8),s->sectnum,g_player[p].ps->oposx,g_player[p].ps->oposy,g_player[p].ps->oposz-((TRAND&31)<<8),g_player[p].ps->cursectnum); // j = 1; @@ -857,7 +857,7 @@ int ifhitbyweapon(int sn) if (j >= 0 && sprite[j].picnum == APLAYER && (gametype_flags[ud.coop] & GAMETYPE_FLAG_TDM) && - g_player[p].ps.team == g_player[sprite[j].yvel].ps.team && + g_player[p].ps->team == g_player[sprite[j].yvel].ps->team && ud.ffire == 0) return -1; @@ -869,27 +869,27 @@ int ifhitbyweapon(int sn) { npc->extra = 0; - g_player[p].ps.wackedbyactor = j; + g_player[p].ps->wackedbyactor = j; if (sprite[hittype[sn].owner].picnum == APLAYER && p != sprite[hittype[sn].owner].yvel) - g_player[p].ps.frag_ps = sprite[j].yvel; + g_player[p].ps->frag_ps = sprite[j].yvel; - hittype[sn].owner = g_player[p].ps.i; + hittype[sn].owner = g_player[p].ps->i; } } if (checkspriteflagsp(hittype[sn].picnum,SPRITE_FLAG_PROJECTILE) && (thisprojectile[sn].workslike & PROJECTILE_FLAG_RPG)) { - g_player[p].ps.posxv += + g_player[p].ps->posxv += hittype[sn].extra*(sintable[(hittype[sn].ang+512)&2047])<<2; - g_player[p].ps.posyv += + g_player[p].ps->posyv += hittype[sn].extra*(sintable[hittype[sn].ang&2047])<<2; } else if (checkspriteflagsp(hittype[sn].picnum,SPRITE_FLAG_PROJECTILE)) { - g_player[p].ps.posxv += + g_player[p].ps->posxv += hittype[sn].extra*(sintable[(hittype[sn].ang+512)&2047])<<1; - g_player[p].ps.posyv += + g_player[p].ps->posyv += hittype[sn].extra*(sintable[hittype[sn].ang&2047])<<1; } @@ -902,15 +902,15 @@ int ifhitbyweapon(int sn) case SEENINE__STATIC: case OOZFILTER__STATIC: case EXPLODINGBARREL__STATIC: - g_player[p].ps.posxv += + g_player[p].ps->posxv += hittype[sn].extra*(sintable[(hittype[sn].ang+512)&2047])<<2; - g_player[p].ps.posyv += + g_player[p].ps->posyv += hittype[sn].extra*(sintable[hittype[sn].ang&2047])<<2; break; default: - g_player[p].ps.posxv += + g_player[p].ps->posxv += hittype[sn].extra*(sintable[(hittype[sn].ang+512)&2047])<<1; - g_player[p].ps.posyv += + g_player[p].ps->posyv += hittype[sn].extra*(sintable[hittype[sn].ang&2047])<<1; break; } @@ -982,18 +982,18 @@ void movedummyplayers(void) p = sprite[OW].yvel; - if (g_player[p].ps.on_crane >= 0 || sector[g_player[p].ps.cursectnum].lotag != 1 || sprite[g_player[p].ps.i].extra <= 0) + if (g_player[p].ps->on_crane >= 0 || sector[g_player[p].ps->cursectnum].lotag != 1 || sprite[g_player[p].ps->i].extra <= 0) { - g_player[p].ps.dummyplayersprite = -1; + g_player[p].ps->dummyplayersprite = -1; KILLIT(i); } else { - if (g_player[p].ps.on_ground && g_player[p].ps.on_warping_sector == 1 && sector[g_player[p].ps.cursectnum].lotag == 1) + if (g_player[p].ps->on_ground && g_player[p].ps->on_warping_sector == 1 && sector[g_player[p].ps->cursectnum].lotag == 1) { CS = 257; SZ = sector[SECT].ceilingz+(27<<8); - SA = g_player[p].ps.ang; + SA = g_player[p].ps->ang; if (T1 == 8) T1 = 0; else T1++; @@ -1005,8 +1005,8 @@ void movedummyplayers(void) } } - SX += (g_player[p].ps.posx-g_player[p].ps.oposx); - SY += (g_player[p].ps.posy-g_player[p].ps.oposy); + SX += (g_player[p].ps->posx-g_player[p].ps->oposx); + SY += (g_player[p].ps->posy-g_player[p].ps->oposy); setsprite(i,SX,SY,SZ); BOLT: @@ -1029,7 +1029,7 @@ static void moveplayers(void) //Players nexti = nextspritestat[i]; s = &sprite[i]; - p = &g_player[s->yvel].ps; + p = g_player[s->yvel].ps; if (s->owner >= 0) { if (p->newowner >= 0) //Looking thru the camera @@ -1053,15 +1053,15 @@ static void moveplayers(void) //Players execute(i,s->yvel,otherx); if (ud.multimode > 1) - if (sprite[g_player[otherp].ps.i].extra > 0) + if (sprite[g_player[otherp].ps->i].extra > 0) { - if (s->yrepeat > 32 && sprite[g_player[otherp].ps.i].yrepeat < 32) + if (s->yrepeat > 32 && sprite[g_player[otherp].ps->i].yrepeat < 32) { if (otherx < 1400 && p->knee_incs == 0) { p->knee_incs = 1; p->weapon_pos = -1; - p->actorsqu = g_player[otherp].ps.i; + p->actorsqu = g_player[otherp].ps->i; } } } @@ -1189,7 +1189,7 @@ static void movefx(void) if (s->lotag >= 1000 && s->lotag < 2000) { - x = ldist(&sprite[g_player[screenpeek].ps.i],s); + x = ldist(&sprite[g_player[screenpeek].ps->i],s); if (x < ht && T1 == 0) { FX_SetReverb(s->lotag - 1000); @@ -1206,7 +1206,7 @@ static void movefx(void) { if ((soundm[s->lotag]&2)) { - x = dist(&sprite[g_player[screenpeek].ps.i],s); + x = dist(&sprite[g_player[screenpeek].ps->i],s); if (x < ht && T1 == 0 && FX_VoiceAvailable(soundpr[s->lotag]-1)) { if (numenvsnds == ud.config.NumVoices) @@ -1214,7 +1214,7 @@ static void movefx(void) j = headspritestat[11]; while (j >= 0) { - if (PN == MUSICANDSFX && j != i && sprite[j].lotag < 999 && hittype[j].temp_data[0] == 1 && dist(&sprite[j],&sprite[g_player[screenpeek].ps.i]) > x) + if (PN == MUSICANDSFX && j != i && sprite[j].lotag < 999 && hittype[j].temp_data[0] == 1 && dist(&sprite[j],&sprite[g_player[screenpeek].ps->i]) > x) { stopenvsound(sprite[j].lotag,j); break; @@ -1236,7 +1236,7 @@ static void movefx(void) { if (T5 > 0) T5--; else for (p=connecthead;p>=0;p=connectpoint2[p]) - if (p == myconnectindex && g_player[p].ps.cursectnum == s->sectnum) + if (p == myconnectindex && g_player[p].ps->cursectnum == s->sectnum) { j = s->lotag+((unsigned)global_random%(s->hitag+1)); sound(j); @@ -1429,10 +1429,10 @@ static void movestandables(void) { if (s->owner==-2) { - spritesound(DUKE_GRUNT,g_player[p].ps.i); + spritesound(DUKE_GRUNT,g_player[p].ps->i); p = findplayer(s,&x); - if (g_player[p].ps.on_crane == i) - g_player[p].ps.on_crane = -1; + if (g_player[p].ps->on_crane == i) + g_player[p].ps->on_crane = -1; } t[0]++; s->owner = -1; @@ -1446,12 +1446,12 @@ static void movestandables(void) if (s->picnum == (CRANE+2)) { p = checkcursectnums(t[1]); - if (p >= 0 && g_player[p].ps.on_ground) + if (p >= 0 && g_player[p].ps->on_ground) { s->owner = -2; - g_player[p].ps.on_crane = i; - spritesound(DUKE_GRUNT,g_player[p].ps.i); - g_player[p].ps.ang = s->ang+1024; + g_player[p].ps->on_crane = i; + spritesound(DUKE_GRUNT,g_player[p].ps->i); + g_player[p].ps->ang = s->ang+1024; } else { @@ -1516,8 +1516,8 @@ static void movestandables(void) IFHIT { if (s->owner == -2) - if (g_player[p].ps.on_crane == i) - g_player[p].ps.on_crane = -1; + if (g_player[p].ps->on_crane == i) + g_player[p].ps->on_crane = -1; s->owner = -1; s->picnum = CRANE; goto BOLT; @@ -1535,11 +1535,11 @@ static void movestandables(void) } else if (s->owner == -2) { - g_player[p].ps.oposx = g_player[p].ps.posx = s->x-(sintable[(g_player[p].ps.ang+512)&2047]>>6); - g_player[p].ps.oposy = g_player[p].ps.posy = s->y-(sintable[g_player[p].ps.ang&2047]>>6); - g_player[p].ps.oposz = g_player[p].ps.posz = s->z+(2<<8); - setsprite(g_player[p].ps.i,g_player[p].ps.posx,g_player[p].ps.posy,g_player[p].ps.posz); - g_player[p].ps.cursectnum = sprite[g_player[p].ps.i].sectnum; + g_player[p].ps->oposx = g_player[p].ps->posx = s->x-(sintable[(g_player[p].ps->ang+512)&2047]>>6); + g_player[p].ps->oposy = g_player[p].ps->posy = s->y-(sintable[g_player[p].ps->ang&2047]>>6); + g_player[p].ps->oposz = g_player[p].ps->posz = s->z+(2<<8); + setsprite(g_player[p].ps->i,g_player[p].ps->posx,g_player[p].ps->posy,g_player[p].ps->posz); + g_player[p].ps->cursectnum = sprite[g_player[p].ps->i].sectnum; } } @@ -2192,7 +2192,7 @@ CLEAR_THE_BOLT: { sector[sect].floorz += sector[sect].extra; p = checkcursectnums(sect); - if (p >= 0) g_player[p].ps.posz += sector[sect].extra; + if (p >= 0) g_player[p].ps->posz += sector[sect].extra; } } else @@ -2207,7 +2207,7 @@ CLEAR_THE_BOLT: sector[sect].floorz -= sector[sect].extra; p = checkcursectnums(sect); if (p >= 0) - g_player[p].ps.posz -= sector[sect].extra; + g_player[p].ps->posz -= sector[sect].extra; } } goto BOLT; @@ -2216,7 +2216,7 @@ CLEAR_THE_BOLT: if (t[5] == 1) goto BOLT; p = checkcursectnums(sect); - if (p >= 0 && (g_player[p].ps.on_ground || s->ang == 512)) + if (p >= 0 && (g_player[p].ps->on_ground || s->ang == 512)) { if (t[0] == 0 && !check_activator_motion(s->lotag)) { @@ -2586,21 +2586,21 @@ static void moveweapons(void) if (thisprojectile[i].workslike & PROJECTILE_FLAG_SPIT) { - g_player[p].ps.horiz += 32; - g_player[p].ps.return_to_center = 8; + g_player[p].ps->horiz += 32; + g_player[p].ps->return_to_center = 8; - if (g_player[p].ps.loogcnt == 0) + if (g_player[p].ps->loogcnt == 0) { - if (!isspritemakingsound(g_player[p].ps.i, DUKE_LONGTERM_PAIN)) - spritesound(DUKE_LONGTERM_PAIN,g_player[p].ps.i); + if (!isspritemakingsound(g_player[p].ps->i, DUKE_LONGTERM_PAIN)) + spritesound(DUKE_LONGTERM_PAIN,g_player[p].ps->i); j = 3+(TRAND&3); - g_player[p].ps.numloogs = j; - g_player[p].ps.loogcnt = 24*4; + g_player[p].ps->numloogs = j; + g_player[p].ps->loogcnt = 24*4; for (x=0;x < j;x++) { - g_player[p].ps.loogiex[x] = TRAND%xdim; - g_player[p].ps.loogiey[x] = TRAND%ydim; + g_player[p].ps->loogiex[x] = TRAND%xdim; + g_player[p].ps->loogiey[x] = TRAND%ydim; } } } @@ -2950,21 +2950,21 @@ static void moveweapons(void) if (s->picnum == SPIT) { - g_player[p].ps.horiz += 32; - g_player[p].ps.return_to_center = 8; + g_player[p].ps->horiz += 32; + g_player[p].ps->return_to_center = 8; - if (g_player[p].ps.loogcnt == 0) + if (g_player[p].ps->loogcnt == 0) { - if (!isspritemakingsound(g_player[p].ps.i, DUKE_LONGTERM_PAIN)) - spritesound(DUKE_LONGTERM_PAIN,g_player[p].ps.i); + if (!isspritemakingsound(g_player[p].ps->i, DUKE_LONGTERM_PAIN)) + spritesound(DUKE_LONGTERM_PAIN,g_player[p].ps->i); j = 3+(TRAND&3); - g_player[p].ps.numloogs = j; - g_player[p].ps.loogcnt = 24*4; + g_player[p].ps->numloogs = j; + g_player[p].ps->loogcnt = 24*4; for (x=0;x < j;x++) { - g_player[p].ps.loogiex[x] = TRAND%xdim; - g_player[p].ps.loogiey[x] = TRAND%ydim; + g_player[p].ps->loogiex[x] = TRAND%xdim; + g_player[p].ps->loogiey[x] = TRAND%ydim; } } } @@ -3150,11 +3150,11 @@ static void movetransports(void) { p = sprite[j].yvel; - g_player[p].ps.on_warping_sector = 1; + g_player[p].ps->on_warping_sector = 1; - if (g_player[p].ps.transporter_hold == 0 && g_player[p].ps.jumping_counter == 0) + if (g_player[p].ps->transporter_hold == 0 && g_player[p].ps->jumping_counter == 0) { - if (g_player[p].ps.on_ground && sectlotag == 0 && onfloorz && g_player[p].ps.jetpack_on == 0) + if (g_player[p].ps->on_ground && sectlotag == 0 && onfloorz && g_player[p].ps->jetpack_on == 0) { if (sprite[i].pal == 0) { @@ -3163,27 +3163,27 @@ static void movetransports(void) } for (k=connecthead;k>=0;k=connectpoint2[k]) - if (g_player[k].ps.cursectnum == sprite[OW].sectnum) + if (g_player[k].ps->cursectnum == sprite[OW].sectnum) { - g_player[k].ps.frag_ps = p; - sprite[g_player[k].ps.i].extra = 0; + g_player[k].ps->frag_ps = p; + sprite[g_player[k].ps->i].extra = 0; } - g_player[p].ps.ang = sprite[OW].ang; + g_player[p].ps->ang = sprite[OW].ang; if (sprite[OW].owner != OW) { T1 = 13; hittype[OW].temp_data[0] = 13; - g_player[p].ps.transporter_hold = 13; + g_player[p].ps->transporter_hold = 13; } - g_player[p].ps.bobposx = g_player[p].ps.oposx = g_player[p].ps.posx = sprite[OW].x; - g_player[p].ps.bobposy = g_player[p].ps.oposy = g_player[p].ps.posy = sprite[OW].y; - g_player[p].ps.oposz = g_player[p].ps.posz = sprite[OW].z-PHEIGHT; + g_player[p].ps->bobposx = g_player[p].ps->oposx = g_player[p].ps->posx = sprite[OW].x; + g_player[p].ps->bobposy = g_player[p].ps->oposy = g_player[p].ps->posy = sprite[OW].y; + g_player[p].ps->oposz = g_player[p].ps->posz = sprite[OW].z-PHEIGHT; changespritesect(j,sprite[OW].sectnum); - g_player[p].ps.cursectnum = sprite[j].sectnum; + g_player[p].ps->cursectnum = sprite[j].sectnum; if (sprite[i].pal == 0) { @@ -3194,34 +3194,34 @@ static void movetransports(void) break; } } - else if (!(sectlotag == 1 && g_player[p].ps.on_ground == 1)) break; + else if (!(sectlotag == 1 && g_player[p].ps->on_ground == 1)) break; - if (onfloorz == 0 && klabs(SZ-g_player[p].ps.posz) < 6144) - if ((g_player[p].ps.jetpack_on == 0) || (g_player[p].ps.jetpack_on && (g_player[p].sync.bits&1)) || - (g_player[p].ps.jetpack_on && (g_player[p].sync.bits&2))) + if (onfloorz == 0 && klabs(SZ-g_player[p].ps->posz) < 6144) + if ((g_player[p].ps->jetpack_on == 0) || (g_player[p].ps->jetpack_on && (g_player[p].sync->bits&1)) || + (g_player[p].ps->jetpack_on && (g_player[p].sync->bits&2))) { - g_player[p].ps.oposx = g_player[p].ps.posx += sprite[OW].x-SX; - g_player[p].ps.oposy = g_player[p].ps.posy += sprite[OW].y-SY; + g_player[p].ps->oposx = g_player[p].ps->posx += sprite[OW].x-SX; + g_player[p].ps->oposy = g_player[p].ps->posy += sprite[OW].y-SY; - if (g_player[p].ps.jetpack_on && ((g_player[p].sync.bits&1) || g_player[p].ps.jetpack_on < 11)) - g_player[p].ps.posz = sprite[OW].z-6144; - else g_player[p].ps.posz = sprite[OW].z+6144; - g_player[p].ps.oposz = g_player[p].ps.posz; + if (g_player[p].ps->jetpack_on && ((g_player[p].sync->bits&1) || g_player[p].ps->jetpack_on < 11)) + g_player[p].ps->posz = sprite[OW].z-6144; + else g_player[p].ps->posz = sprite[OW].z+6144; + g_player[p].ps->oposz = g_player[p].ps->posz; - hittype[g_player[p].ps.i].bposx = g_player[p].ps.posx; - hittype[g_player[p].ps.i].bposy = g_player[p].ps.posy; - hittype[g_player[p].ps.i].bposz = g_player[p].ps.posz; + hittype[g_player[p].ps->i].bposx = g_player[p].ps->posx; + hittype[g_player[p].ps->i].bposy = g_player[p].ps->posy; + hittype[g_player[p].ps->i].bposz = g_player[p].ps->posz; changespritesect(j,sprite[OW].sectnum); - g_player[p].ps.cursectnum = sprite[OW].sectnum; + g_player[p].ps->cursectnum = sprite[OW].sectnum; break; } k = 0; - if (onfloorz && sectlotag == 1 && g_player[p].ps.on_ground && g_player[p].ps.posz > (sector[sect].floorz-1080) && ((g_player[p].sync.bits&2) || g_player[p].ps.poszv > 2048)) - // if( onfloorz && sectlotag == 1 && g_player[p].ps.posz > (sector[sect].floorz-(6<<8)) ) + if (onfloorz && sectlotag == 1 && g_player[p].ps->on_ground && g_player[p].ps->posz > (sector[sect].floorz-1080) && ((g_player[p].sync->bits&2) || g_player[p].ps->poszv > 2048)) + // if( onfloorz && sectlotag == 1 && g_player[p].ps->posz > (sector[sect].floorz-(6<<8)) ) { k = 1; if (screenpeek == p) @@ -3229,17 +3229,17 @@ static void movetransports(void) FX_StopAllSounds(); clearsoundlocks(); } - if (sprite[g_player[p].ps.i].extra > 0) + if (sprite[g_player[p].ps->i].extra > 0) spritesound(DUKE_UNDERWATER,j); - g_player[p].ps.oposz = g_player[p].ps.posz = - sector[sprite[OW].sectnum].ceilingz; + g_player[p].ps->oposz = g_player[p].ps->posz = + sector[sprite[OW].sectnum].ceilingz; - g_player[p].ps.posxv = 4096-(TRAND&8192); - g_player[p].ps.posyv = 4096-(TRAND&8192); - // g_player[p].ps.poszv += 1080; + g_player[p].ps->posxv = 4096-(TRAND&8192); + g_player[p].ps->posyv = 4096-(TRAND&8192); + // g_player[p].ps->poszv += 1080; } - if (onfloorz && sectlotag == 2 && g_player[p].ps.posz < (sector[sect].ceilingz+1080) && g_player[p].ps.poszv == 0) + if (onfloorz && sectlotag == 2 && g_player[p].ps->posz < (sector[sect].ceilingz+1080) && g_player[p].ps->poszv == 0) { k = 1; // if( sprite[j].extra <= 0) break; @@ -3250,27 +3250,27 @@ static void movetransports(void) } spritesound(DUKE_GASP,j); - g_player[p].ps.oposz = g_player[p].ps.posz = - sector[sprite[OW].sectnum].floorz; + g_player[p].ps->oposz = g_player[p].ps->posz = + sector[sprite[OW].sectnum].floorz; - g_player[p].ps.jumping_toggle = 1; - g_player[p].ps.jumping_counter = 0; - // g_player[p].ps.poszv += 1024; + g_player[p].ps->jumping_toggle = 1; + g_player[p].ps->jumping_counter = 0; + // g_player[p].ps->poszv += 1024; } if (k == 1) { - g_player[p].ps.oposx = g_player[p].ps.posx += sprite[OW].x-SX; - g_player[p].ps.oposy = g_player[p].ps.posy += sprite[OW].y-SY; + g_player[p].ps->oposx = g_player[p].ps->posx += sprite[OW].x-SX; + g_player[p].ps->oposy = g_player[p].ps->posy += sprite[OW].y-SY; if (sprite[OW].owner != OW) - g_player[p].ps.transporter_hold = -2; - g_player[p].ps.cursectnum = sprite[OW].sectnum; + g_player[p].ps->transporter_hold = -2; + g_player[p].ps->cursectnum = sprite[OW].sectnum; changespritesect(j,sprite[OW].sectnum); - setsprite(g_player[p].ps.i,g_player[p].ps.posx,g_player[p].ps.posy,g_player[p].ps.posz+PHEIGHT); + setsprite(g_player[p].ps->i,g_player[p].ps->posx,g_player[p].ps->posy,g_player[p].ps->posz+PHEIGHT); - setpal(&g_player[p].ps); + setpal(g_player[p].ps); if ((TRAND&255) < 32) spawn(j,WATERSPLASH2); @@ -3278,7 +3278,7 @@ static void movetransports(void) if (sectlotag == 1) for (l = 0;l < 9;l++) { - q = spawn(g_player[p].ps.i,WATERBUBBLE); + q = spawn(g_player[p].ps->i,WATERBUBBLE); sprite[q].z += TRAND&16383; } } @@ -3641,16 +3641,16 @@ static void moveactors(void) // if(s->pal == 12) { - j = getincangle(g_player[p].ps.ang,getangle(s->x-g_player[p].ps.posx,s->y-g_player[p].ps.posy)); - if (j > -64 && j < 64 && (g_player[p].sync.bits&(1<<29))) - if (g_player[p].ps.toggle_key_flag == 1) + j = getincangle(g_player[p].ps->ang,getangle(s->x-g_player[p].ps->posx,s->y-g_player[p].ps->posy)); + if (j > -64 && j < 64 && (g_player[p].sync->bits&(1<<29))) + if (g_player[p].ps->toggle_key_flag == 1) { a = headspritestat[1]; while (a >= 0) { if (sprite[a].picnum == QUEBALL || sprite[a].picnum == STRIPEBALL) { - j = getincangle(g_player[p].ps.ang,getangle(sprite[a].x-g_player[p].ps.posx,sprite[a].y-g_player[p].ps.posy)); + j = getincangle(g_player[p].ps->ang,getangle(sprite[a].x-g_player[p].ps->posx,sprite[a].y-g_player[p].ps->posy)); if (j > -64 && j < 64) { findplayer(&sprite[a],&l); @@ -3664,15 +3664,15 @@ static void moveactors(void) if (s->pal == 12) s->xvel = 164; else s->xvel = 140; - s->ang = g_player[p].ps.ang; - g_player[p].ps.toggle_key_flag = 2; + s->ang = g_player[p].ps->ang; + g_player[p].ps->toggle_key_flag = 2; } } } } - if (x < 512 && s->sectnum == g_player[p].ps.cursectnum) + if (x < 512 && s->sectnum == g_player[p].ps->cursectnum) { - s->ang = getangle(s->x-g_player[p].ps.posx,s->y-g_player[p].ps.posy); + s->ang = getangle(s->x-g_player[p].ps->posx,s->y-g_player[p].ps->posy); s->xvel = 48; } } @@ -3768,7 +3768,7 @@ static void moveactors(void) RANDOMSCRAP; spritesound(LASERTRIP_EXPLODE,i); spawn(i,PIGCOP); - g_player[myconnectindex].ps.actors_killed++; + g_player[myconnectindex].ps->actors_killed++; KILLIT(i); } goto BOLT; @@ -3795,13 +3795,13 @@ static void moveactors(void) shoot(i,FIRELASER); s->ang = a; } - if (t[2] > (26*3) || !cansee(s->x,s->y,s->z-(16<<8),s->sectnum, g_player[p].ps.posx,g_player[p].ps.posy,g_player[p].ps.posz,g_player[p].ps.cursectnum)) + if (t[2] > (26*3) || !cansee(s->x,s->y,s->z-(16<<8),s->sectnum, g_player[p].ps->posx,g_player[p].ps->posy,g_player[p].ps->posz,g_player[p].ps->cursectnum)) { t[0] = 0; t[2] = 0; } else hittype[i].tempang += - getincangle(hittype[i].tempang,getangle(g_player[p].ps.posx-s->x,g_player[p].ps.posy-s->y))/3; + getincangle(hittype[i].tempang,getangle(g_player[p].ps->posx-s->x,g_player[p].ps->posy-s->y))/3; } else if (t[0] == 2 || t[0] == 3) { @@ -3811,14 +3811,14 @@ static void moveactors(void) if (t[0] == 2) { - l = g_player[p].ps.posz-s->z; + l = g_player[p].ps->posz-s->z; if (klabs(l) < (48<<8)) t[0] = 3; - else s->z += ksgn(g_player[p].ps.posz-s->z)<<10; + else s->z += ksgn(g_player[p].ps->posz-s->z)<<10; } else { t[2]++; - if (t[2] > (26*3) || !cansee(s->x,s->y,s->z-(16<<8),s->sectnum, g_player[p].ps.posx,g_player[p].ps.posy,g_player[p].ps.posz,g_player[p].ps.cursectnum)) + if (t[2] > (26*3) || !cansee(s->x,s->y,s->z-(16<<8),s->sectnum, g_player[p].ps->posx,g_player[p].ps->posy,g_player[p].ps->posz,g_player[p].ps->cursectnum)) { t[0] = 1; t[2] = 0; @@ -3829,7 +3829,7 @@ static void moveactors(void) shoot(i,FIRELASER); } } - s->ang += getincangle(s->ang,getangle(g_player[p].ps.posx-s->x,g_player[p].ps.posy-s->y))>>2; + s->ang += getincangle(s->ang,getangle(g_player[p].ps->posx-s->x,g_player[p].ps->posy-s->y))>>2; } if (t[0] != 2 && t[0] != 3) @@ -3988,11 +3988,11 @@ static void moveactors(void) spritesound(GLASS_BREAKING,i); KILLIT(i); } - else if (x < 1024 && g_player[p].ps.quick_kick == 0) + else if (x < 1024 && g_player[p].ps->quick_kick == 0) { - j = getincangle(g_player[p].ps.ang,getangle(SX-g_player[p].ps.posx,SY-g_player[p].ps.posy)); + j = getincangle(g_player[p].ps->ang,getangle(SX-g_player[p].ps->posx,SY-g_player[p].ps->posy)); if (j > -128 && j < 128) - g_player[p].ps.quick_kick = 14; + g_player[p].ps->quick_kick = 14; } goto BOLT; @@ -4004,7 +4004,7 @@ static void moveactors(void) if (t[0] == -4) //On the player { - if (sprite[g_player[p].ps.i].extra < 1) + if (sprite[g_player[p].ps->i].extra < 1) { t[0] = 0; goto BOLT; @@ -4012,10 +4012,10 @@ static void moveactors(void) setsprite(i,s->x,s->y,s->z); - s->ang = g_player[p].ps.ang; + s->ang = g_player[p].ps->ang; - if (((g_player[p].sync.bits&4) || (g_player[p].ps.quick_kick > 0)) && sprite[g_player[p].ps.i].extra > 0) - if (g_player[p].ps.quick_kick > 0 || (g_player[p].ps.curr_weapon != HANDREMOTE_WEAPON && g_player[p].ps.curr_weapon != HANDBOMB_WEAPON && g_player[p].ps.curr_weapon != TRIPBOMB_WEAPON && g_player[p].ps.ammo_amount[g_player[p].ps.curr_weapon] >= 0)) + if (((g_player[p].sync->bits&4) || (g_player[p].ps->quick_kick > 0)) && sprite[g_player[p].ps->i].extra > 0) + if (g_player[p].ps->quick_kick > 0 || (g_player[p].ps->curr_weapon != HANDREMOTE_WEAPON && g_player[p].ps->curr_weapon != HANDBOMB_WEAPON && g_player[p].ps->curr_weapon != TRIPBOMB_WEAPON && g_player[p].ps->ammo_amount[g_player[p].ps->curr_weapon] >= 0)) { for (x=0;x<8;x++) { @@ -4030,16 +4030,16 @@ static void moveactors(void) j = spawn(i,BLOODPOOL); sprite[j].pal = 0; } - g_player[p].ps.actors_killed ++; + g_player[p].ps->actors_killed ++; t[0] = -3; - if (g_player[p].ps.somethingonplayer == i) - g_player[p].ps.somethingonplayer = -1; + if (g_player[p].ps->somethingonplayer == i) + g_player[p].ps->somethingonplayer = -1; KILLIT(i); } - s->z = g_player[p].ps.posz+g_player[p].ps.pyoff-t[2]+(8<<8); + s->z = g_player[p].ps->posz+g_player[p].ps->pyoff-t[2]+(8<<8); - s->z += (100-g_player[p].ps.horiz)<<4; + s->z += (100-g_player[p].ps->horiz)<<4; if (t[2] > 512) t[2] -= 128; @@ -4047,16 +4047,16 @@ static void moveactors(void) if (t[2] < 348) t[2] += 128; - if (g_player[p].ps.newowner >= 0) + if (g_player[p].ps->newowner >= 0) { - g_player[p].ps.newowner = -1; - g_player[p].ps.posx = g_player[p].ps.oposx; - g_player[p].ps.posy = g_player[p].ps.oposy; - g_player[p].ps.posz = g_player[p].ps.oposz; - g_player[p].ps.ang = g_player[p].ps.oang; + g_player[p].ps->newowner = -1; + g_player[p].ps->posx = g_player[p].ps->oposx; + g_player[p].ps->posy = g_player[p].ps->oposy; + g_player[p].ps->posz = g_player[p].ps->oposz; + g_player[p].ps->ang = g_player[p].ps->oang; - updatesector(g_player[p].ps.posx,g_player[p].ps.posy,&g_player[p].ps.cursectnum); - setpal(&g_player[p].ps); + updatesector(g_player[p].ps->posx,g_player[p].ps->posy,&g_player[p].ps->cursectnum); + setpal(g_player[p].ps); j = headspritestat[1]; while (j >= 0) @@ -4074,7 +4074,7 @@ static void moveactors(void) if (t[3] == 5) { - sprite[g_player[p].ps.i].extra += -(5+(TRAND&3)); + sprite[g_player[p].ps->i].extra += -(5+(TRAND&3)); spritesound(SLIM_ATTACK,i); } @@ -4092,17 +4092,17 @@ static void moveactors(void) s->xrepeat = 20+(sintable[t[1]&2047]>>13); s->yrepeat = 15+(sintable[t[1]&2047]>>13); - s->x = g_player[p].ps.posx + (sintable[(g_player[p].ps.ang+512)&2047]>>7); - s->y = g_player[p].ps.posy + (sintable[g_player[p].ps.ang&2047]>>7); + s->x = g_player[p].ps->posx + (sintable[(g_player[p].ps->ang+512)&2047]>>7); + s->y = g_player[p].ps->posy + (sintable[g_player[p].ps->ang&2047]>>7); goto BOLT; } else if (s->xvel < 64 && x < 768) { - if (g_player[p].ps.somethingonplayer == -1) + if (g_player[p].ps->somethingonplayer == -1) { - g_player[p].ps.somethingonplayer = i; + g_player[p].ps->somethingonplayer = i; if (t[0] == 3 || t[0] == 2) //Falling downward t[2] = (12<<8); else t[2] = -(13<<8); //Climbing up duke @@ -4114,9 +4114,9 @@ static void moveactors(void) { spritesound(SLIM_DYING,i); - g_player[p].ps.actors_killed ++; - if (g_player[p].ps.somethingonplayer == i) - g_player[p].ps.somethingonplayer = -1; + g_player[p].ps->actors_killed ++; + if (g_player[p].ps->somethingonplayer == i) + g_player[p].ps->somethingonplayer = -1; if (j == FREEZEBLAST) { @@ -4192,7 +4192,7 @@ static void moveactors(void) // JBF 20041129: a slimer eating another enemy really ought // to decrease the maximum kill count by one. - if (sprite[t[5]].extra > 0) g_player[myconnectindex].ps.max_actors_killed--; + if (sprite[t[5]].extra > 0) g_player[myconnectindex].ps->max_actors_killed--; } } } @@ -4265,7 +4265,7 @@ static void moveactors(void) s->xvel = 64 - (sintable[(t[1]+512)&2047]>>9); s->ang += getincangle(s->ang, - getangle(g_player[p].ps.posx-s->x,g_player[p].ps.posy-s->y))>>3; + getangle(g_player[p].ps->posx-s->x,g_player[p].ps->posy-s->y))>>3; // TJR } @@ -4466,7 +4466,7 @@ DETONATEB: } // } - if ((l >= 0 && g_player[l].ps.hbomb_on == 0 && hittype[i].temp_data[6] == 2) || t[3] == 1) + if ((l >= 0 && g_player[l].ps->hbomb_on == 0 && hittype[i].temp_data[6] == 2) || t[3] == 1) hittype[i].temp_data[6] = 3; if (hittype[i].temp_data[6] == 3) @@ -4523,36 +4523,36 @@ DETONATEB: } } else if (s->picnum == HEAVYHBOMB && x < 788 && t[0] > 7 && s->xvel == 0) - if (cansee(s->x,s->y,s->z-(8<<8),s->sectnum,g_player[p].ps.posx,g_player[p].ps.posy,g_player[p].ps.posz,g_player[p].ps.cursectnum)) - if (g_player[p].ps.ammo_amount[HANDBOMB_WEAPON] < max_ammo_amount[HANDBOMB_WEAPON]) + if (cansee(s->x,s->y,s->z-(8<<8),s->sectnum,g_player[p].ps->posx,g_player[p].ps->posy,g_player[p].ps->posz,g_player[p].ps->cursectnum)) + if (g_player[p].ps->ammo_amount[HANDBOMB_WEAPON] < max_ammo_amount[HANDBOMB_WEAPON]) { if ((gametype_flags[ud.coop] & GAMETYPE_FLAG_WEAPSTAY) && s->owner == i) { - for (j=0;jpicnum) + for (j=0;jweapreccnt;j++) + if (g_player[p].ps->weaprecs[j] == s->picnum) goto BOLT; - if (g_player[p].ps.weapreccnt < 255) - g_player[p].ps.weaprecs[g_player[p].ps.weapreccnt++] = s->picnum; + if (g_player[p].ps->weapreccnt < 255) + g_player[p].ps->weaprecs[g_player[p].ps->weapreccnt++] = s->picnum; } - addammo(HANDBOMB_WEAPON,&g_player[p].ps,1); - spritesound(DUKE_GET,g_player[p].ps.i); + addammo(HANDBOMB_WEAPON,g_player[p].ps,1); + spritesound(DUKE_GET,g_player[p].ps->i); - if (g_player[p].ps.gotweapon[HANDBOMB_WEAPON] == 0 || s->owner == g_player[p].ps.i) + if (g_player[p].ps->gotweapon[HANDBOMB_WEAPON] == 0 || s->owner == g_player[p].ps->i) { - /* addweapon(&g_player[p].ps,HANDBOMB_WEAPON); */ - if (!(g_player[p].ps.weaponswitch & 1) && *aplWeaponWorksLike[g_player[p].ps.curr_weapon] != HANDREMOTE_WEAPON) - addweaponnoswitch(&g_player[p].ps,HANDBOMB_WEAPON); - else addweapon(&g_player[p].ps,HANDBOMB_WEAPON); + /* addweapon(g_player[p].ps,HANDBOMB_WEAPON); */ + if (!(g_player[p].ps->weaponswitch & 1) && *aplWeaponWorksLike[g_player[p].ps->curr_weapon] != HANDREMOTE_WEAPON) + addweaponnoswitch(g_player[p].ps,HANDBOMB_WEAPON); + else addweapon(g_player[p].ps,HANDBOMB_WEAPON); } if (sprite[s->owner].picnum != APLAYER) { - g_player[p].ps.pals[0] = 0; - g_player[p].ps.pals[1] = 32; - g_player[p].ps.pals[2] = 0; - g_player[p].ps.pals_time = 32; + g_player[p].ps->pals[0] = 0; + g_player[p].ps->pals[1] = 32; + g_player[p].ps->pals[2] = 0; + g_player[p].ps->pals_time = 32; } if (s->owner != i || ud.respawn_items == 0) @@ -4624,16 +4624,16 @@ DETONATEB: { if ((TRAND&255) < 16) { - if (!isspritemakingsound(g_player[p].ps.i, DUKE_LONGTERM_PAIN)) - spritesound(DUKE_LONGTERM_PAIN,g_player[p].ps.i); + if (!isspritemakingsound(g_player[p].ps->i, DUKE_LONGTERM_PAIN)) + spritesound(DUKE_LONGTERM_PAIN,g_player[p].ps->i); spritesound(SHORT_CIRCUIT,i); - sprite[g_player[p].ps.i].extra --; - g_player[p].ps.pals_time = 32; - g_player[p].ps.pals[0] = 32; - g_player[p].ps.pals[1] = 0; - g_player[p].ps.pals[2] = 0; + sprite[g_player[p].ps->i].extra --; + g_player[p].ps->pals_time = 32; + g_player[p].ps->pals[0] = 32; + g_player[p].ps->pals[1] = 0; + g_player[p].ps->pals[2] = 0; } t[0] += 128; if (t[3] == 0) @@ -4856,9 +4856,9 @@ static void moveexplosions(void) // STATNUM 5 else if (t[0] == 16) { s->picnum = NUKEBUTTON+2; - g_player[sprite[s->owner].yvel].ps.fist_incs = 1; + g_player[sprite[s->owner].yvel].ps->fist_incs = 1; } - if (g_player[sprite[s->owner].yvel].ps.fist_incs == 26) + if (g_player[sprite[s->owner].yvel].ps->fist_incs == 26) s->picnum = NUKEBUTTON+3; } goto BOLT; @@ -4954,11 +4954,11 @@ static void moveexplosions(void) // STATNUM 5 p = findplayer(s,&x); if (x < 512) { - g_player[p].ps.pals_time = 32; - g_player[p].ps.pals[0] = 32; - g_player[p].ps.pals[1] = 0; - g_player[p].ps.pals[2] = 0; - sprite[g_player[p].ps.i].extra -= 4; + g_player[p].ps->pals_time = 32; + g_player[p].ps->pals[0] = 32; + g_player[p].ps->pals[1] = 0; + g_player[p].ps->pals[2] = 0; + sprite[g_player[p].ps->i].extra -= 4; } case FIRELASER__STATIC: @@ -5169,17 +5169,17 @@ static void moveexplosions(void) // STATNUM 5 { if (s->pal == 0 && (TRAND&255) < 16 && s->picnum != PUKE) { - if (g_player[p].ps.boot_amount > 0) - g_player[p].ps.boot_amount--; + if (g_player[p].ps->boot_amount > 0) + g_player[p].ps->boot_amount--; else { - if (!isspritemakingsound(g_player[p].ps.i,DUKE_LONGTERM_PAIN)) - spritesound(DUKE_LONGTERM_PAIN,g_player[p].ps.i); - sprite[g_player[p].ps.i].extra --; - g_player[p].ps.pals_time = 32; - g_player[p].ps.pals[0] = 16; - g_player[p].ps.pals[1] = 0; - g_player[p].ps.pals[2] = 0; + if (!isspritemakingsound(g_player[p].ps->i,DUKE_LONGTERM_PAIN)) + spritesound(DUKE_LONGTERM_PAIN,g_player[p].ps->i); + sprite[g_player[p].ps->i].extra --; + g_player[p].ps->pals_time = 32; + g_player[p].ps->pals[0] = 16; + g_player[p].ps->pals[1] = 0; + g_player[p].ps->pals[2] = 0; } } @@ -5187,11 +5187,11 @@ static void moveexplosions(void) // STATNUM 5 t[1] = 1; if (hittype[i].picnum == TIRE) - g_player[p].ps.footprintcount = 10; - else g_player[p].ps.footprintcount = 3; + g_player[p].ps->footprintcount = 10; + else g_player[p].ps->footprintcount = 3; - g_player[p].ps.footprintpal = s->pal; - g_player[p].ps.footprintshade = s->shade; + g_player[p].ps->footprintpal = s->pal; + g_player[p].ps->footprintshade = s->shade; if (t[2] == 32) { @@ -5471,26 +5471,26 @@ static void moveeffectors(void) //STATNUM 3 { for (p=connecthead;p>=0;p=connectpoint2[p]) { - if (g_player[p].ps.cursectnum == s->sectnum && g_player[p].ps.on_ground == 1) + if (g_player[p].ps->cursectnum == s->sectnum && g_player[p].ps->on_ground == 1) { - g_player[p].ps.ang += (l*q); - g_player[p].ps.ang &= 2047; + g_player[p].ps->ang += (l*q); + g_player[p].ps->ang &= 2047; - g_player[p].ps.posz += zchange; + g_player[p].ps->posz += zchange; - rotatepoint(sprite[j].x,sprite[j].y,g_player[p].ps.posx,g_player[p].ps.posy,(q*l),&m,&x); + rotatepoint(sprite[j].x,sprite[j].y,g_player[p].ps->posx,g_player[p].ps->posy,(q*l),&m,&x); - g_player[p].ps.bobposx += m-g_player[p].ps.posx; - g_player[p].ps.bobposy += x-g_player[p].ps.posy; + g_player[p].ps->bobposx += m-g_player[p].ps->posx; + g_player[p].ps->bobposy += x-g_player[p].ps->posy; - g_player[p].ps.posx = m; - g_player[p].ps.posy = x; + g_player[p].ps->posx = m; + g_player[p].ps->posy = x; - if (sprite[g_player[p].ps.i].extra <= 0) + if (sprite[g_player[p].ps->i].extra <= 0) { - sprite[g_player[p].ps.i].x = m; - sprite[g_player[p].ps.i].y = x; + sprite[g_player[p].ps->i].x = m; + sprite[g_player[p].ps->i].y = x; } } } @@ -5630,7 +5630,7 @@ static void moveeffectors(void) //STATNUM 3 if (x < 20480) { j = s->ang; - s->ang = getangle(s->x-g_player[p].ps.posx,s->y-g_player[p].ps.posy); + s->ang = getangle(s->x-g_player[p].ps->posx,s->y-g_player[p].ps->posy); shoot(i,RPG); s->ang = j; } @@ -5644,18 +5644,18 @@ static void moveeffectors(void) //STATNUM 3 { if (ud.clipping == 0 && s->xvel >= 192) for (p=connecthead;p>=0;p=connectpoint2[p]) - if (sprite[g_player[p].ps.i].extra > 0) + if (sprite[g_player[p].ps->i].extra > 0) { - k = g_player[p].ps.cursectnum; - updatesector(g_player[p].ps.posx,g_player[p].ps.posy,&k); - if ((k == -1 && ud.clipping == 0) || (k == s->sectnum && g_player[p].ps.cursectnum != s->sectnum)) + k = g_player[p].ps->cursectnum; + updatesector(g_player[p].ps->posx,g_player[p].ps->posy,&k); + if ((k == -1 && ud.clipping == 0) || (k == s->sectnum && g_player[p].ps->cursectnum != s->sectnum)) { - g_player[p].ps.posx = s->x; - g_player[p].ps.posy = s->y; - g_player[p].ps.cursectnum = s->sectnum; + g_player[p].ps->posx = s->x; + g_player[p].ps->posy = s->y; + g_player[p].ps->cursectnum = s->sectnum; - setsprite(g_player[p].ps.i,s->x,s->y,s->z); - quickkill(&g_player[p].ps); + setsprite(g_player[p].ps->i,s->x,s->y,s->z); + quickkill(g_player[p].ps); } } } @@ -5664,35 +5664,35 @@ static void moveeffectors(void) //STATNUM 3 x = (s->xvel*sintable[s->ang&2047])>>14; for (p = connecthead;p >= 0;p=connectpoint2[p]) - if (sector[g_player[p].ps.cursectnum].lotag != 2) + if (sector[g_player[p].ps->cursectnum].lotag != 2) { - if (g_player[p].po.os == s->sectnum) + if (g_PlayerSpawnPoints[p].os == s->sectnum) { - g_player[p].po.ox += m; - g_player[p].po.oy += x; + g_PlayerSpawnPoints[p].ox += m; + g_PlayerSpawnPoints[p].oy += x; } - if (s->sectnum == sprite[g_player[p].ps.i].sectnum) + if (s->sectnum == sprite[g_player[p].ps->i].sectnum) { - rotatepoint(s->x,s->y,g_player[p].ps.posx,g_player[p].ps.posy,q,&g_player[p].ps.posx,&g_player[p].ps.posy); + rotatepoint(s->x,s->y,g_player[p].ps->posx,g_player[p].ps->posy,q,&g_player[p].ps->posx,&g_player[p].ps->posy); - g_player[p].ps.posx += m; - g_player[p].ps.posy += x; + g_player[p].ps->posx += m; + g_player[p].ps->posy += x; - g_player[p].ps.bobposx += m; - g_player[p].ps.bobposy += x; + g_player[p].ps->bobposx += m; + g_player[p].ps->bobposy += x; - g_player[p].ps.ang += q; + g_player[p].ps->ang += q; if (numplayers > 1) { - g_player[p].ps.oposx = g_player[p].ps.posx; - g_player[p].ps.oposy = g_player[p].ps.posy; + g_player[p].ps->oposx = g_player[p].ps->posx; + g_player[p].ps->oposy = g_player[p].ps->posy; } - if (sprite[g_player[p].ps.i].extra <= 0) + if (sprite[g_player[p].ps->i].extra <= 0) { - sprite[g_player[p].ps.i].x = g_player[p].ps.posx; - sprite[g_player[p].ps.i].y = g_player[p].ps.posy; + sprite[g_player[p].ps->i].x = g_player[p].ps->posx; + sprite[g_player[p].ps->i].y = g_player[p].ps->posy; } } } @@ -5724,18 +5724,18 @@ static void moveeffectors(void) //STATNUM 3 { if (ud.clipping == 0 && s->xvel >= 192) for (p=connecthead;p>=0;p=connectpoint2[p]) - if (sprite[g_player[p].ps.i].extra > 0) + if (sprite[g_player[p].ps->i].extra > 0) { - k = g_player[p].ps.cursectnum; - updatesector(g_player[p].ps.posx,g_player[p].ps.posy,&k); - if ((k == -1 && ud.clipping == 0) || (k == s->sectnum && g_player[p].ps.cursectnum != s->sectnum)) + k = g_player[p].ps->cursectnum; + updatesector(g_player[p].ps->posx,g_player[p].ps->posy,&k); + if ((k == -1 && ud.clipping == 0) || (k == s->sectnum && g_player[p].ps->cursectnum != s->sectnum)) { - g_player[p].ps.oposx = g_player[p].ps.posx = s->x; - g_player[p].ps.oposy = g_player[p].ps.posy = s->y; - g_player[p].ps.cursectnum = s->sectnum; + g_player[p].ps->oposx = g_player[p].ps->posx = s->x; + g_player[p].ps->oposy = g_player[p].ps->posy = s->y; + g_player[p].ps->cursectnum = s->sectnum; - setsprite(g_player[p].ps.i,s->x,s->y,s->z); - quickkill(&g_player[p].ps); + setsprite(g_player[p].ps->i,s->x,s->y,s->z); + quickkill(g_player[p].ps); } } @@ -5823,42 +5823,42 @@ static void moveeffectors(void) //STATNUM 3 if ((sc->floorz-sc->ceilingz) < (108<<8)) if (ud.clipping == 0) for (p=connecthead;p>=0;p=connectpoint2[p]) - if (sprite[g_player[p].ps.i].extra > 0) + if (sprite[g_player[p].ps->i].extra > 0) { - k = g_player[p].ps.cursectnum; - updatesector(g_player[p].ps.posx,g_player[p].ps.posy,&k); - if ((k == -1 && ud.clipping == 0) || (k == s->sectnum && g_player[p].ps.cursectnum != s->sectnum)) + k = g_player[p].ps->cursectnum; + updatesector(g_player[p].ps->posx,g_player[p].ps->posy,&k); + if ((k == -1 && ud.clipping == 0) || (k == s->sectnum && g_player[p].ps->cursectnum != s->sectnum)) { - g_player[p].ps.posx = s->x; - g_player[p].ps.posy = s->y; - g_player[p].ps.cursectnum = s->sectnum; + g_player[p].ps->posx = s->x; + g_player[p].ps->posy = s->y; + g_player[p].ps->cursectnum = s->sectnum; - setsprite(g_player[p].ps.i,s->x,s->y,s->z); - quickkill(&g_player[p].ps); + setsprite(g_player[p].ps->i,s->x,s->y,s->z); + quickkill(g_player[p].ps); } } for (p = connecthead;p >= 0;p = connectpoint2[p]) { - if (sprite[g_player[p].ps.i].sectnum == s->sectnum) + if (sprite[g_player[p].ps->i].sectnum == s->sectnum) { - g_player[p].ps.posx += l; - g_player[p].ps.posy += x; + g_player[p].ps->posx += l; + g_player[p].ps->posy += x; if (numplayers > 1) { - g_player[p].ps.oposx = g_player[p].ps.posx; - g_player[p].ps.oposy = g_player[p].ps.posy; + g_player[p].ps->oposx = g_player[p].ps->posx; + g_player[p].ps->oposy = g_player[p].ps->posy; } - g_player[p].ps.bobposx += l; - g_player[p].ps.bobposy += x; + g_player[p].ps->bobposx += l; + g_player[p].ps->bobposy += x; } - if (g_player[p].po.os == s->sectnum) + if (g_PlayerSpawnPoints[p].os == s->sectnum) { - g_player[p].po.ox += l; - g_player[p].po.oy += x; + g_PlayerSpawnPoints[p].ox += l; + g_PlayerSpawnPoints[p].oy += x; } } @@ -5892,22 +5892,22 @@ static void moveeffectors(void) //STATNUM 3 { if (ud.clipping == 0) for (p=connecthead;p>=0;p=connectpoint2[p]) - if (sprite[g_player[p].ps.i].extra > 0) + if (sprite[g_player[p].ps->i].extra > 0) { - k = g_player[p].ps.cursectnum; - updatesector(g_player[p].ps.posx,g_player[p].ps.posy,&k); - if ((k == -1 && ud.clipping == 0) || (k == s->sectnum && g_player[p].ps.cursectnum != s->sectnum)) + k = g_player[p].ps->cursectnum; + updatesector(g_player[p].ps->posx,g_player[p].ps->posy,&k); + if ((k == -1 && ud.clipping == 0) || (k == s->sectnum && g_player[p].ps->cursectnum != s->sectnum)) { - g_player[p].ps.posx = s->x; - g_player[p].ps.posy = s->y; + g_player[p].ps->posx = s->x; + g_player[p].ps->posy = s->y; - g_player[p].ps.oposx = g_player[p].ps.posx; - g_player[p].ps.oposy = g_player[p].ps.posy; + g_player[p].ps->oposx = g_player[p].ps->posx; + g_player[p].ps->oposy = g_player[p].ps->posy; - g_player[p].ps.cursectnum = s->sectnum; + g_player[p].ps->cursectnum = s->sectnum; - setsprite(g_player[p].ps.i,s->x,s->y,s->z); - quickkill(&g_player[p].ps); + setsprite(g_player[p].ps->i,s->x,s->y,s->z); + quickkill(g_player[p].ps); } } @@ -5963,7 +5963,7 @@ static void moveeffectors(void) //STATNUM 3 if ((t[0]&31) == 8) { earthquaketime = 48; - spritesound(EARTHQUAKE,g_player[screenpeek].ps.i); + spritesound(EARTHQUAKE,g_player[screenpeek].ps->i); } if (klabs(sc->floorheinum-t[5]) < 8) @@ -5976,13 +5976,13 @@ static void moveeffectors(void) //STATNUM 3 for (p=connecthead;p>=0;p=connectpoint2[p]) - if (g_player[p].ps.cursectnum == s->sectnum && g_player[p].ps.on_ground) + if (g_player[p].ps->cursectnum == s->sectnum && g_player[p].ps->on_ground) { - g_player[p].ps.posx += m; - g_player[p].ps.posy += x; + g_player[p].ps->posx += m; + g_player[p].ps->posy += x; - g_player[p].ps.bobposx += m; - g_player[p].ps.bobposy += x; + g_player[p].ps->bobposx += m; + g_player[p].ps->bobposy += x; } j = headspritesect[s->sectnum]; @@ -6108,7 +6108,7 @@ static void moveeffectors(void) //STATNUM 3 if (x < 8192) { j = s->ang; - s->ang = getangle(s->x-g_player[p].ps.posx,s->y-g_player[p].ps.posy); + s->ang = getangle(s->x-g_player[p].ps->posx,s->y-g_player[p].ps->posy); shoot(i,FIRELASER); s->ang = j; } @@ -6123,7 +6123,7 @@ static void moveeffectors(void) //STATNUM 3 if (s->owner==-1) break; - m = ldist(&sprite[g_player[p].ps.i],&sprite[s->owner]); + m = ldist(&sprite[g_player[p].ps->i],&sprite[s->owner]); if (l > m) { @@ -6142,7 +6142,7 @@ static void moveeffectors(void) //STATNUM 3 { short ta; ta = s->ang; - s->ang = getangle(g_player[p].ps.posx-s->x,g_player[p].ps.posy-s->y); + s->ang = getangle(g_player[p].ps->posx-s->x,g_player[p].ps->posy-s->y); s->ang = ta; s->owner = -1; goto BOLT; @@ -6162,7 +6162,7 @@ static void moveeffectors(void) //STATNUM 3 else { t[2] += - getincangle(t[2]+512,getangle(g_player[p].ps.posx-s->x,g_player[p].ps.posy-s->y))>>2; + getincangle(t[2]+512,getangle(g_player[p].ps->posx-s->x,g_player[p].ps->posy-s->y))>>2; sc->ceilingshade = 0; } IFHIT @@ -6171,7 +6171,7 @@ static void moveeffectors(void) //STATNUM 3 if (t[3] == 5) { s->zvel += 1024; - FTA(7,&g_player[myconnectindex].ps); + FTA(7,g_player[myconnectindex].ps); } } @@ -6263,7 +6263,7 @@ static void moveeffectors(void) //STATNUM 3 if ((sc->lotag&0xff) != 27) for (p=connecthead;p>=0;p=connectpoint2[p]) if (sc->lotag != 30 && sc->lotag != 31 && sc->lotag != 0) - if (s->sectnum == sprite[g_player[p].ps.i].sectnum) + if (s->sectnum == sprite[g_player[p].ps->i].sectnum) j = 0; if (j == 1) @@ -6455,12 +6455,12 @@ static void moveeffectors(void) //STATNUM 3 sc->floorshade = s->shade; - if (g_player[0].ps.one_parallax_sectnum >= 0) + if (g_player[0].ps->one_parallax_sectnum >= 0) { sc->ceilingpicnum = - sector[g_player[0].ps.one_parallax_sectnum].ceilingpicnum; + sector[g_player[0].ps->one_parallax_sectnum].ceilingpicnum; sc->ceilingshade = - sector[g_player[0].ps.one_parallax_sectnum].ceilingshade; + sector[g_player[0].ps->one_parallax_sectnum].ceilingshade; } } } @@ -6556,12 +6556,12 @@ static void moveeffectors(void) //STATNUM 3 { p = sprite[j].yvel; if (numplayers < 2) - g_player[p].ps.oposz = g_player[p].ps.posz; - g_player[p].ps.posz += q; - g_player[p].ps.truefz += q; - g_player[p].ps.truecz += q; + g_player[p].ps->oposz = g_player[p].ps->posz; + g_player[p].ps->posz += q; + g_player[p].ps->truefz += q; + g_player[p].ps->truecz += q; if (numplayers > 1) - g_player[p].ps.oposz = g_player[p].ps.posz; + g_player[p].ps->oposz = g_player[p].ps->posz; } if (sprite[j].statnum != 3) { @@ -6615,23 +6615,23 @@ static void moveeffectors(void) //STATNUM 3 { p = sprite[k].yvel; - g_player[p].ps.posx += sprite[j].x-s->x; - g_player[p].ps.posy += sprite[j].y-s->y; - g_player[p].ps.posz = sector[sprite[j].sectnum].floorz-(sc->floorz-g_player[p].ps.posz); + g_player[p].ps->posx += sprite[j].x-s->x; + g_player[p].ps->posy += sprite[j].y-s->y; + g_player[p].ps->posz = sector[sprite[j].sectnum].floorz-(sc->floorz-g_player[p].ps->posz); hittype[k].floorz = sector[sprite[j].sectnum].floorz; hittype[k].ceilingz = sector[sprite[j].sectnum].ceilingz; - g_player[p].ps.bobposx = g_player[p].ps.oposx = g_player[p].ps.posx; - g_player[p].ps.bobposy = g_player[p].ps.oposy = g_player[p].ps.posy; - g_player[p].ps.oposz = g_player[p].ps.posz; + g_player[p].ps->bobposx = g_player[p].ps->oposx = g_player[p].ps->posx; + g_player[p].ps->bobposy = g_player[p].ps->oposy = g_player[p].ps->posy; + g_player[p].ps->oposz = g_player[p].ps->posz; - g_player[p].ps.truefz = hittype[k].floorz; - g_player[p].ps.truecz = hittype[k].ceilingz; - g_player[p].ps.bobcounter = 0; + g_player[p].ps->truefz = hittype[k].floorz; + g_player[p].ps->truecz = hittype[k].ceilingz; + g_player[p].ps->bobcounter = 0; changespritesect(k,sprite[j].sectnum); - g_player[p].ps.cursectnum = sprite[j].sectnum; + g_player[p].ps->cursectnum = sprite[j].sectnum; } else if (sprite[k].statnum != 3) { @@ -6679,8 +6679,8 @@ static void moveeffectors(void) //STATNUM 3 while (j >= 0) { if (sprite[j].picnum == APLAYER && sprite[j].owner >= 0) - if (g_player[sprite[j].yvel].ps.on_ground == 1) - g_player[sprite[j].yvel].ps.posz += sc->extra; + if (g_player[sprite[j].yvel].ps->on_ground == 1) + g_player[sprite[j].yvel].ps->posz += sc->extra; if (sprite[j].zvel == 0 && sprite[j].statnum != 3 && sprite[j].statnum != 4) { hittype[j].bposz = sprite[j].z += sc->extra; @@ -6713,8 +6713,8 @@ static void moveeffectors(void) //STATNUM 3 while (j >= 0) { if (sprite[j].picnum == APLAYER && sprite[j].owner >= 0) - if (g_player[sprite[j].yvel].ps.on_ground == 1) - g_player[sprite[j].yvel].ps.posz -= sc->extra; + if (g_player[sprite[j].yvel].ps->on_ground == 1) + g_player[sprite[j].yvel].ps->posz -= sc->extra; if (sprite[j].zvel == 0 && sprite[j].statnum != 3 && sprite[j].statnum != 4) { hittype[j].bposz = sprite[j].z -= sc->extra; @@ -6789,7 +6789,7 @@ static void moveeffectors(void) //STATNUM 3 { IFHITSECT { - FTA(8,&g_player[myconnectindex].ps); + FTA(8,g_player[myconnectindex].ps); l = headspritestat[3]; while (l >= 0) @@ -6877,15 +6877,15 @@ static void moveeffectors(void) //STATNUM 3 dragpoint((short)t[2],wall[t[2]].x+x,wall[t[2]].y+l); for (p=connecthead;p>=0;p=connectpoint2[p]) - if (g_player[p].ps.cursectnum == s->sectnum && g_player[p].ps.on_ground) + if (g_player[p].ps->cursectnum == s->sectnum && g_player[p].ps->on_ground) { - g_player[p].ps.posx += x; - g_player[p].ps.posy += l; + g_player[p].ps->posx += x; + g_player[p].ps->posy += l; - g_player[p].ps.oposx = g_player[p].ps.posx; - g_player[p].ps.oposy = g_player[p].ps.posy; + g_player[p].ps->oposx = g_player[p].ps->posx; + g_player[p].ps->oposy = g_player[p].ps->posy; - setsprite(g_player[p].ps.i,g_player[p].ps.posx,g_player[p].ps.posy,g_player[p].ps.posz+PHEIGHT); + setsprite(g_player[p].ps->i,g_player[p].ps->posx,g_player[p].ps->posy,g_player[p].ps->posz+PHEIGHT); } sc->floorxpanning-=x>>3; @@ -7013,8 +7013,8 @@ static void moveeffectors(void) //STATNUM 3 } p = myconnectindex; - if (g_player[p].ps.cursectnum == s->sectnum && g_player[p].ps.on_ground) - if (klabs(g_player[p].ps.posz-g_player[p].ps.truefz) < PHEIGHT+(9<<8)) + if (g_player[p].ps->cursectnum == s->sectnum && g_player[p].ps->on_ground) + if (klabs(g_player[p].ps->posz-g_player[p].ps->truefz) < PHEIGHT+(9<<8)) { fricxv += x<<3; fricyv += l<<3; @@ -7117,15 +7117,15 @@ static void moveeffectors(void) //STATNUM 3 } p = myconnectindex; - if (sprite[g_player[p].ps.i].sectnum == s->sectnum && g_player[p].ps.on_ground) + if (sprite[g_player[p].ps->i].sectnum == s->sectnum && g_player[p].ps->on_ground) { fricxv += l<<5; fricyv += x<<5; } for (p = connecthead;p >= 0;p = connectpoint2[p]) - if (sprite[g_player[p].ps.i].sectnum == s->sectnum && g_player[p].ps.on_ground) - g_player[p].ps.posz += s->zvel; + if (sprite[g_player[p].ps->i].sectnum == s->sectnum && g_player[p].ps->on_ground) + g_player[p].ps->posz += s->zvel; ms(i); setsprite(i,s->x,s->y,s->z); @@ -7140,23 +7140,23 @@ static void moveeffectors(void) //STATNUM 3 hittype[i].tempang = s->ang; p = findplayer(s,&x); - if (sprite[g_player[p].ps.i].extra > 0 && myconnectindex == screenpeek) + if (sprite[g_player[p].ps->i].extra > 0 && myconnectindex == screenpeek) { if (t[0] < 0) { ud.camerasprite = i; t[0]++; } - else if (ud.recstat == 2 && g_player[p].ps.newowner == -1) + else if (ud.recstat == 2 && g_player[p].ps->newowner == -1) { - if (cansee(s->x,s->y,s->z,SECT,g_player[p].ps.posx,g_player[p].ps.posy,g_player[p].ps.posz,g_player[p].ps.cursectnum)) + if (cansee(s->x,s->y,s->z,SECT,g_player[p].ps->posx,g_player[p].ps->posy,g_player[p].ps->posz,g_player[p].ps->cursectnum)) { if (x < (long)((unsigned)sh)) { ud.camerasprite = i; t[0] = 999; - s->ang += getincangle(s->ang,getangle(g_player[p].ps.posx-s->x,g_player[p].ps.posy-s->y))>>3; - SP = 100+((s->z-g_player[p].ps.posz)/257); + s->ang += getincangle(s->ang,getangle(g_player[p].ps->posx-s->x,g_player[p].ps->posy-s->y))>>3; + SP = 100+((s->z-g_player[p].ps->posz)/257); } else if (t[0] == 999) @@ -7170,7 +7170,7 @@ static void moveeffectors(void) //STATNUM 3 } else { - s->ang = getangle(g_player[p].ps.posx-s->x,g_player[p].ps.posy-s->y); + s->ang = getangle(g_player[p].ps->posx-s->x,g_player[p].ps->posy-s->y); if (t[0] == 999) { @@ -7205,7 +7205,7 @@ static void moveeffectors(void) //STATNUM 3 if (T3 > T2) { T1 = 0; - g_player[screenpeek].ps.visibility = ud.const_visibility; + g_player[screenpeek].ps->visibility = ud.const_visibility; break; } else if (T3 == (T2>>1)) @@ -7224,17 +7224,17 @@ static void moveeffectors(void) //STATNUM 3 } else if (T3 > (T2>>3) && T3 < (T2>>2)) { - if (cansee(s->x,s->y,s->z,s->sectnum,g_player[screenpeek].ps.posx,g_player[screenpeek].ps.posy,g_player[screenpeek].ps.posz,g_player[screenpeek].ps.cursectnum)) + if (cansee(s->x,s->y,s->z,s->sectnum,g_player[screenpeek].ps->posx,g_player[screenpeek].ps->posy,g_player[screenpeek].ps->posz,g_player[screenpeek].ps->cursectnum)) j = 1; else j = 0; if (rnd(192) && (T3&1)) { if (j) - g_player[screenpeek].ps.visibility = 0; + g_player[screenpeek].ps->visibility = 0; } else if (j) - g_player[screenpeek].ps.visibility = ud.const_visibility; + g_player[screenpeek].ps->visibility = ud.const_visibility; j = headspritestat[0]; while (j >= 0) @@ -7247,17 +7247,17 @@ static void moveeffectors(void) //STATNUM 3 spawn(j,SMALLSMOKE); p = findplayer(s,&x); - x = ldist(&sprite[g_player[p].ps.i], &sprite[j]); + x = ldist(&sprite[g_player[p].ps->i], &sprite[j]); if (x < 768) { - if (!isspritemakingsound(g_player[p].ps.i,DUKE_LONGTERM_PAIN)) - spritesound(DUKE_LONGTERM_PAIN,g_player[p].ps.i); - spritesound(SHORT_CIRCUIT,g_player[p].ps.i); - sprite[g_player[p].ps.i].extra -= 8+(TRAND&7); - g_player[p].ps.pals_time = 32; - g_player[p].ps.pals[0] = 16; - g_player[p].ps.pals[1] = 0; - g_player[p].ps.pals[2] = 0; + if (!isspritemakingsound(g_player[p].ps->i,DUKE_LONGTERM_PAIN)) + spritesound(DUKE_LONGTERM_PAIN,g_player[p].ps->i); + spritesound(SHORT_CIRCUIT,g_player[p].ps->i); + sprite[g_player[p].ps->i].extra -= 8+(TRAND&7); + g_player[p].ps->pals_time = 32; + g_player[p].ps->pals[0] = 16; + g_player[p].ps->pals[1] = 0; + g_player[p].ps->pals[2] = 0; } break; } @@ -7306,8 +7306,8 @@ static void moveeffectors(void) //STATNUM 3 while (j >= 0) { if (sprite[j].picnum == APLAYER && sprite[j].owner >= 0) - if (g_player[sprite[j].yvel].ps.on_ground == 1) - g_player[sprite[j].yvel].ps.posz += l; + if (g_player[sprite[j].yvel].ps->on_ground == 1) + g_player[sprite[j].yvel].ps->posz += l; if (sprite[j].zvel == 0 && sprite[j].statnum != 3 && sprite[j].statnum != 4) { hittype[j].bposz = sprite[j].z += l; @@ -7336,8 +7336,8 @@ static void moveeffectors(void) //STATNUM 3 while (j >= 0) { if (sprite[j].picnum == APLAYER && sprite[j].owner >= 0) - if (g_player[sprite[j].yvel].ps.on_ground == 1) - g_player[sprite[j].yvel].ps.posz += l; + if (g_player[sprite[j].yvel].ps->on_ground == 1) + g_player[sprite[j].yvel].ps->posz += l; if (sprite[j].zvel == 0 && sprite[j].statnum != 3 && sprite[j].statnum != 4) { hittype[j].bposz = sprite[j].z += l; @@ -7368,8 +7368,8 @@ static void moveeffectors(void) //STATNUM 3 while (j >= 0) { if (sprite[j].picnum == APLAYER && sprite[j].owner >= 0) - if (g_player[sprite[j].yvel].ps.on_ground == 1) - g_player[sprite[j].yvel].ps.posz += l; + if (g_player[sprite[j].yvel].ps->on_ground == 1) + g_player[sprite[j].yvel].ps->posz += l; if (sprite[j].zvel == 0 && sprite[j].statnum != 3 && sprite[j].statnum != 4) { hittype[j].bposz = sprite[j].z += l; @@ -7397,8 +7397,8 @@ static void moveeffectors(void) //STATNUM 3 while (j >= 0) { if (sprite[j].picnum == APLAYER && sprite[j].owner >= 0) - if (g_player[sprite[j].yvel].ps.on_ground == 1) - g_player[sprite[j].yvel].ps.posz -= l; + if (g_player[sprite[j].yvel].ps->on_ground == 1) + g_player[sprite[j].yvel].ps->posz -= l; if (sprite[j].zvel == 0 && sprite[j].statnum != 3 && sprite[j].statnum != 4) { hittype[j].bposz = sprite[j].z -= l; diff --git a/polymer/eduke32/source/anim.c b/polymer/eduke32/source/anim.c index 089fe2b3b..d73d84e3e 100644 --- a/polymer/eduke32/source/anim.c +++ b/polymer/eduke32/source/anim.c @@ -248,7 +248,7 @@ void playanm(const char *fn,char t) //setpalette(0L,256L,tempbuf); //setbrightness(ud.brightness>>2,tempbuf,2); - setgamepalette(&g_player[myconnectindex].ps,animpal,10); + setgamepalette(g_player[myconnectindex].ps,animpal,10); #if defined(POLYMOST) && defined(USE_OPENGL) gltexfiltermode = 0; @@ -267,7 +267,7 @@ void playanm(const char *fn,char t) getpackets(); if (restorepalette == 1) { - setgamepalette(&g_player[myconnectindex].ps,animpal,0); + setgamepalette(g_player[myconnectindex].ps,animpal,0); restorepalette = 0; } idle(); diff --git a/polymer/eduke32/source/config.c b/polymer/eduke32/source/config.c index 6f7f16ee2..a47ee3d29 100644 --- a/polymer/eduke32/source/config.c +++ b/polymer/eduke32/source/config.c @@ -196,7 +196,7 @@ void CONFIG_SetDefaults(void) ud.config.MusicDevice = 0; ud.config.MusicToggle = 1; ud.config.MusicVolume = 200; - myaimmode = g_player[0].ps.aim_mode = 1; + myaimmode = g_player[0].ps->aim_mode = 1; ud.config.NumBits = 16; ud.config.NumChannels = 2; ud.config.NumVoices = 32; @@ -651,7 +651,7 @@ int32 CONFIG_ReadSetup(void) SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "ShowFPS",&ud.tickrate); SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "Color",&ud.color); check_player_color((int *)&ud.color,-1); - g_player[0].ps.palookup = g_player[0].pcolor = ud.color; + g_player[0].ps->palookup = g_player[0].pcolor = ud.color; SCRIPT_GetNumber(ud.config.scripthandle, "Misc", "Team",&dummy); ud.team = 0; if (dummy < 4 && dummy > -1) ud.team = dummy; @@ -696,7 +696,7 @@ int32 CONFIG_ReadSetup(void) SCRIPT_GetNumber(ud.config.scripthandle, "Controls","MouseAimingFlipped",&ud.mouseflip); // mouse aiming inverted SCRIPT_GetNumber(ud.config.scripthandle, "Controls","MouseAiming",&ud.mouseaiming); // 1=momentary/0=toggle - g_player[0].ps.aim_mode = ud.mouseaiming; + g_player[0].ps->aim_mode = ud.mouseaiming; SCRIPT_GetNumber(ud.config.scripthandle, "Controls","MouseBias",&ud.config.MouseBias); SCRIPT_GetNumber(ud.config.scripthandle, "Controls","MouseFilter",&ud.config.MouseFilter); SCRIPT_GetNumber(ud.config.scripthandle, "Controls","SmoothInput",&ud.config.SmoothInput); @@ -705,9 +705,9 @@ int32 CONFIG_ReadSetup(void) SCRIPT_GetNumber(ud.config.scripthandle, "Controls","AimingFlag",(int32 *)&myaimmode); // (if toggle mode) gives state SCRIPT_GetNumber(ud.config.scripthandle, "Controls","RunKeyBehaviour",&ud.runkey_mode); // JBF 20031125 SCRIPT_GetNumber(ud.config.scripthandle, "Controls","AutoAim",&ud.config.AutoAim); // JBF 20031125 - g_player[0].ps.auto_aim = ud.config.AutoAim; + g_player[0].ps->auto_aim = ud.config.AutoAim; SCRIPT_GetNumber(ud.config.scripthandle, "Controls","WeaponSwitchMode",&ud.weaponswitch); - g_player[0].ps.weaponswitch = ud.weaponswitch; + g_player[0].ps->weaponswitch = ud.weaponswitch; #ifdef _WIN32 SCRIPT_GetNumber(ud.config.scripthandle, "Updates", "CheckForUpdates", &ud.config.CheckForUpdates); diff --git a/polymer/eduke32/source/duke3d.h b/polymer/eduke32/source/duke3d.h index 849c3a4ad..b8b2770ce 100644 --- a/polymer/eduke32/source/duke3d.h +++ b/polymer/eduke32/source/duke3d.h @@ -304,7 +304,7 @@ typedef struct { unsigned long bits, extbits; } input; -#define sync dsync // JBF 20040604: sync is a function on some platforms +// #define sync dsync // JBF 20040604: sync is a function on some platforms extern input recsync[RECSYNCBUFSIZ]; extern long movefifosendplc; @@ -933,8 +933,8 @@ enum logoflags { LOGO_FLAG_TENSCREEN = 512 }; -extern char numl; -extern int condebug; +extern int g_NumPalettes; +extern int g_ScriptDebug; #define MAXCHEATLEN 20 #define NUMCHEATCODES (signed int)(sizeof(cheatquotes)/sizeof(cheatquotes[MAXCHEATLEN])) @@ -956,9 +956,8 @@ typedef struct { extern map_t map[MAXVOLUMES*MAXLEVELS]; typedef struct { - player_struct ps; - player_orig po; - input sync; + player_struct *ps; + input *sync; long movefifoend; long syncvalhead; @@ -973,9 +972,13 @@ typedef struct { char user_name[32]; char playerreadyflag; char playerquitflag; + + char vote; + char gotvote; } playerdata_t; extern input inputfifo[MOVEFIFOSIZ][MAXPLAYERS]; +extern player_orig g_PlayerSpawnPoints[MAXPLAYERS]; extern playerdata_t g_player[MAXPLAYERS]; #include "funct.h" diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index a5834f62b..7a07523b7 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -91,7 +91,7 @@ static int userconfiles = 0; static int netparamcount = 0; static char **netparam = NULL; -int votes[MAXPLAYERS], gotvote[MAXPLAYERS], voting = -1; +int voting = -1; int vote_map = -1, vote_episode = -1; int recfilep,totalreccnt; @@ -228,7 +228,7 @@ static void patchstatusbar(long x1, long y1, long x2, long y2) void setgamepalette(player_struct *player, char *pal, int set) { - if (player != &g_player[screenpeek].ps) + if (player != g_player[screenpeek].ps) { // another head player->palette = pal; @@ -510,11 +510,11 @@ void getpackets(void) { KB_ClearKeyDown(sc_F12); screencapture("duke0000.tga",0); - FTA(103,&g_player[myconnectindex].ps); + FTA(103,g_player[myconnectindex].ps); } // only dispatch commands here when not in a game - if (!(g_player[myconnectindex].ps.gm&MODE_GAME)) + if (!(g_player[myconnectindex].ps->gm&MODE_GAME)) { OSD_DispatchQueued(); } @@ -785,19 +785,19 @@ void getpackets(void) for (i=3;packbuf[i];i++) g_player[other].user_name[i-3] = packbuf[i]; - g_player[other].user_name[i-3] = 0; + g_player[other].user_name[i-3] = 0; i++; - g_player[other].ps.aim_mode = packbuf[i++]; - g_player[other].ps.auto_aim = packbuf[i++]; - g_player[other].ps.weaponswitch = packbuf[i++]; - g_player[other].ps.palookup = g_player[other].pcolor = packbuf[i++]; + g_player[other].ps->aim_mode = packbuf[i++]; + g_player[other].ps->auto_aim = packbuf[i++]; + g_player[other].ps->weaponswitch = packbuf[i++]; + g_player[other].ps->palookup = g_player[other].pcolor = packbuf[i++]; g_player[other].pteam = packbuf[i++]; - /* if(g_player[other].ps.team != j && sprite[g_player[other].ps.i].picnum == APLAYER) + /* if(g_player[other].ps->team != j && sprite[g_player[other].ps->i].picnum == APLAYER) { - hittype[g_player[other].ps.i].extra = 1000; - hittype[g_player[other].ps.i].picnum = APLAYERTOP; + hittype[g_player[other].ps->i].extra = 1000; + hittype[g_player[other].ps->i].picnum = APLAYERTOP; } */ break; @@ -813,7 +813,7 @@ void getpackets(void) i = 2; j = i; //This used to be Duke packet #9... now concatenated with Duke packet #6 - for (;i-j<10;i++) g_player[other].wchoice[i-j] = packbuf[i]; + for (;i-j<10;i++) g_player[other].wchoice[i-j] = packbuf[i]; break; case 7: @@ -912,11 +912,11 @@ void getpackets(void) switch (packbuf[1]) { case 0: - if (voting == myconnectindex && gotvote[(unsigned char)packbuf[2]] == 0) + if (voting == myconnectindex && g_player[(unsigned char)packbuf[2]].gotvote == 0) { - gotvote[(unsigned char)packbuf[2]] = 1; - votes[(unsigned char)packbuf[2]] = packbuf[3]; - Bsprintf(tempbuf,"GOT VOTE FROM %s",g_player[(unsigned char)packbuf[2]].user_name); + g_player[(unsigned char)packbuf[2]].gotvote = 1; + g_player[(unsigned char)packbuf[2]].vote = packbuf[3]; + Bsprintf(tempbuf,"GOT VOTE FROM %s",g_player[(unsigned char)packbuf[2]].user_name); adduserquote(tempbuf); } break; @@ -925,13 +925,16 @@ void getpackets(void) voting = packbuf[2]; vote_episode = packbuf[3]; vote_map = packbuf[4]; - Bsprintf(tempbuf,"%s^00 HAS CALLED A VOTE TO CHANGE MAP TO %s (E%dL%d)",g_player[(unsigned char)packbuf[2]].user_name,map[(unsigned char)(packbuf[3]*MAXLEVELS + packbuf[4])].name,packbuf[3]+1,packbuf[4]+1); + Bsprintf(tempbuf,"%s^00 HAS CALLED A VOTE TO CHANGE MAP TO %s (E%dL%d)",g_player[(unsigned char)packbuf[2]].user_name,map[(unsigned char)(packbuf[3]*MAXLEVELS + packbuf[4])].name,packbuf[3]+1,packbuf[4]+1); adduserquote(tempbuf); Bsprintf(tempbuf,"PRESS F1 TO VOTE YES, F2 TO VOTE NO"); adduserquote(tempbuf); - Bmemset(votes,0,sizeof(votes)); - Bmemset(gotvote,0,sizeof(gotvote)); - gotvote[voting] = votes[voting] = 1; + for (i=0;icursectnum].floorpal, a = 0; if (orientation&4) a = 1024; @@ -1540,7 +1546,7 @@ void myospal(long x, long y, int tilenum, int shade, int orientation, int p) void myosx(long x, long y, int tilenum, int shade, int orientation) { - int p = sector[g_player[screenpeek].ps.cursectnum].floorpal, a = 0; + int p = sector[g_player[screenpeek].ps->cursectnum].floorpal, a = 0; if (orientation&4) a = 1024; @@ -1878,9 +1884,9 @@ void displayfragbar(void) for (i=connecthead;i>=0;i=connectpoint2[i]) { - minitext(21+(73*(i&3)),2+((i&28)<<1),&g_player[i].user_name[0],/*sprite[g_player[i].ps.i].pal*/g_player[i].ps.palookup,2+8+16); - Bsprintf(tempbuf,"%d",g_player[i].ps.frag-g_player[i].ps.fraggedself); - minitext(17+50+(73*(i&3)),2+((i&28)<<1),tempbuf,/*sprite[g_player[i].ps.i].pal*/g_player[i].ps.palookup,2+8+16); + minitext(21+(73*(i&3)),2+((i&28)<<1),&g_player[i].user_name[0],/*sprite[g_player[i].ps->i].pal*/g_player[i].ps->palookup,2+8+16); + Bsprintf(tempbuf,"%d",g_player[i].ps->frag-g_player[i].ps->fraggedself); + minitext(17+50+(73*(i&3)),2+((i&28)<<1),tempbuf,/*sprite[g_player[i].ps->i].pal*/g_player[i].ps->palookup,2+8+16); } } @@ -1888,13 +1894,13 @@ void displayfragbar(void) static void coolgaugetext(int snum) { - player_struct *p = &g_player[snum].ps; + player_struct *p = g_player[snum].ps; long i, j, o, ss = ud.screen_size, u; int permbit = 0; if (ss < 4) return; - if (g_player[snum].ps.gm&MODE_MENU) + if (g_player[snum].ps->gm&MODE_MENU) if ((current_menu >= 400 && current_menu <= 405)) return; @@ -1909,7 +1915,7 @@ static void coolgaugetext(int snum) else { for (i=connecthead;i>=0;i=connectpoint2[i]) - if (g_player[i].ps.frag != sbar.frag[i]) + if (g_player[i].ps->frag != sbar.frag[i]) { displayfragbar(); break; @@ -1918,7 +1924,7 @@ static void coolgaugetext(int snum) } for (i=connecthead;i>=0;i=connectpoint2[i]) if (i != myconnectindex) - sbar.frag[i] = g_player[i].ps.frag; + sbar.frag[i] = g_player[i].ps->frag; } if (ss == 4) //DRAW MINI STATUS BAR: @@ -2319,7 +2325,7 @@ static void tics(void) if (i != frameval[framecnt]) { j=(timer*AVERAGEFRAMES)/(i-frameval[framecnt]); - if (ud.tickrate && !(g_player[myconnectindex].ps.gm&MODE_MENU)) + if (ud.tickrate && !(g_player[myconnectindex].ps->gm&MODE_MENU)) { int ii, k = 0, p = 8; @@ -2361,29 +2367,29 @@ static void coords(int snum) else if (ud.multimode > 1) y = 16; } - sprintf(tempbuf,"X= %ld",g_player[snum].ps.posx); + sprintf(tempbuf,"X= %ld",g_player[snum].ps->posx); printext256(250L,y,31,-1,tempbuf,0); - sprintf(tempbuf,"Y= %ld",g_player[snum].ps.posy); + sprintf(tempbuf,"Y= %ld",g_player[snum].ps->posy); printext256(250L,y+9L,31,-1,tempbuf,0); - Bsprintf(tempbuf,"Z= %ld",g_player[snum].ps.posz); + Bsprintf(tempbuf,"Z= %ld",g_player[snum].ps->posz); printext256(250L,y+18L,31,-1,tempbuf,0); - Bsprintf(tempbuf,"A= %d",g_player[snum].ps.ang); + Bsprintf(tempbuf,"A= %d",g_player[snum].ps->ang); printext256(250L,y+27L,31,-1,tempbuf,0); - Bsprintf(tempbuf,"H= %ld",g_player[snum].ps.horiz); + Bsprintf(tempbuf,"H= %ld",g_player[snum].ps->horiz); printext256(250L,y+36L,31,-1,tempbuf,0); - Bsprintf(tempbuf,"ZV= %ld",g_player[snum].ps.poszv); + Bsprintf(tempbuf,"ZV= %ld",g_player[snum].ps->poszv); printext256(250L,y+45L,31,-1,tempbuf,0); - Bsprintf(tempbuf,"OG= %d",g_player[snum].ps.on_ground); + Bsprintf(tempbuf,"OG= %d",g_player[snum].ps->on_ground); printext256(250L,y+54L,31,-1,tempbuf,0); - Bsprintf(tempbuf,"AM= %d",g_player[snum].ps.ammo_amount[GROW_WEAPON]); + Bsprintf(tempbuf,"AM= %d",g_player[snum].ps->ammo_amount[GROW_WEAPON]); printext256(250L,y+63L,31,-1,tempbuf,0); - Bsprintf(tempbuf,"LFW= %d",g_player[snum].ps.last_full_weapon); + Bsprintf(tempbuf,"LFW= %d",g_player[snum].ps->last_full_weapon); printext256(250L,y+72L,31,-1,tempbuf,0); - Bsprintf(tempbuf,"SECTL= %d",sector[g_player[snum].ps.cursectnum].lotag); + Bsprintf(tempbuf,"SECTL= %d",sector[g_player[snum].ps->cursectnum].lotag); printext256(250L,y+81L,31,-1,tempbuf,0); Bsprintf(tempbuf,"SEED= %ld",randomseed); printext256(250L,y+90L,31,-1,tempbuf,0); - Bsprintf(tempbuf,"THOLD= %d",g_player[snum].ps.transporter_hold); + Bsprintf(tempbuf,"THOLD= %d",g_player[snum].ps->transporter_hold); printext256(250L,y+99L+7,31,-1,tempbuf,0); } @@ -2395,7 +2401,7 @@ static void operatefta(void) quotebot = min(quotebot,j); quotebotgoal = min(quotebotgoal,j); - if (g_player[myconnectindex].ps.gm&MODE_TYPE) j -= 8; + if (g_player[myconnectindex].ps->gm&MODE_TYPE) j -= 8; quotebotgoal = j; j = quotebot; for (i=0;ifta <= 1) return; - if (fta_quotes[g_player[screenpeek].ps.ftq] == NULL) + if (fta_quotes[g_player[screenpeek].ps->ftq] == NULL) { - OSD_Printf("%s %d null quote %d\n",__FILE__,__LINE__,g_player[screenpeek].ps.ftq); + OSD_Printf("%s %d null quote %d\n",__FILE__,__LINE__,g_player[screenpeek].ps->ftq); return; } @@ -2441,7 +2447,7 @@ static void operatefta(void) else if (j > 12) k += 24; } - if (g_player[screenpeek].ps.ftq == 115 || g_player[screenpeek].ps.ftq == 116 || g_player[screenpeek].ps.ftq == 117) + if (g_player[screenpeek].ps->ftq == 115 || g_player[screenpeek].ps->ftq == 116 || g_player[screenpeek].ps->ftq == 117) { k = quotebot-8-4; /* for(i=0;ifta; if (j > 4) - gametext(320>>1,k,fta_quotes[g_player[screenpeek].ps.ftq],0,2+8+16); + gametext(320>>1,k,fta_quotes[g_player[screenpeek].ps->ftq],0,2+8+16); else - if (j > 2) gametext(320>>1,k,fta_quotes[g_player[screenpeek].ps.ftq],0,2+8+16+1); + if (j > 2) gametext(320>>1,k,fta_quotes[g_player[screenpeek].ps->ftq],0,2+8+16+1); else - gametext(320>>1,k,fta_quotes[g_player[screenpeek].ps.ftq],0,2+8+16+1+32); + gametext(320>>1,k,fta_quotes[g_player[screenpeek].ps->ftq],0,2+8+16+1+32); } void FTA(int q,player_struct *p) @@ -2487,7 +2493,7 @@ void FTA(int q,player_struct *p) // || q == 26 || q == 115 || q ==116 || q == 117 || q == 122) { if (p->ftq != q) - if (p == &g_player[screenpeek].ps) + if (p == g_player[screenpeek].ps) OSD_Printf("%s\n",stripcolorcodes(fta_quotes[q])); p->ftq = q; @@ -2514,8 +2520,8 @@ static void showtwoscreens(void) { setview(0,0,xdim-1,ydim-1); flushperms(); - //g_player[myconnectindex].ps.palette = palette; - setgamepalette(&g_player[myconnectindex].ps, palette, 1); // JBF 20040308 + //g_player[myconnectindex].ps->palette = palette; + setgamepalette(g_player[myconnectindex].ps, palette, 1); // JBF 20040308 fadepal(0,0,0, 0,64,7); KB_FlushKeyboardQueue(); rotatesprite(0,0,65536L,0,3291,0,0,2+8+16+64, 0,0,xdim-1,ydim-1); @@ -2543,8 +2549,8 @@ static void showtwoscreens(void) { setview(0,0,xdim-1,ydim-1); flushperms(); - //g_player[myconnectindex].ps.palette = palette; - setgamepalette(&g_player[myconnectindex].ps, palette, 1); // JBF 20040308 + //g_player[myconnectindex].ps->palette = palette; + setgamepalette(g_player[myconnectindex].ps, palette, 1); // JBF 20040308 fadepal(0,0,0, 0,64,7); KB_FlushKeyboardQueue(); rotatesprite(0,0,65536L,0,TENSCREEN,0,0,2+8+16+64, 0,0,xdim-1,ydim-1); @@ -2562,7 +2568,7 @@ extern long qsetmode; void gameexit(const char *t) { - if (*t != 0) g_player[myconnectindex].ps.palette = (char *) &palette[0]; + if (*t != 0) g_player[myconnectindex].ps->palette = (char *) &palette[0]; if (numplayers > 1) allowtimetocorrecterrorswhenquitting(); @@ -2577,7 +2583,7 @@ void gameexit(const char *t) if (!qe && !cp) { - if (playerswhenstarted > 1 && g_player[myconnectindex].ps.gm&MODE_GAME && GTFLAGS(GAMETYPE_FLAG_SCORESHEET) && *t == ' ') + if (playerswhenstarted > 1 && g_player[myconnectindex].ps->gm&MODE_GAME && GTFLAGS(GAMETYPE_FLAG_SCORESHEET) && *t == ' ') { dobonus(1); setgamemode(ud.config.ScreenMode,ud.config.ScreenWidth,ud.config.ScreenHeight,ud.config.ScreenBPP); @@ -2616,7 +2622,7 @@ static int strget_(int small,int x,int y,char *t,int dalen,int c) short ch; int i; - while ((ch = KB_Getch()) != 0 || (g_player[myconnectindex].ps.gm&MODE_MENU && MOUSE_GetButtons()&RIGHT_MOUSE)) + while ((ch = KB_Getch()) != 0 || (g_player[myconnectindex].ps->gm&MODE_MENU && MOUSE_GetButtons()&RIGHT_MOUSE)) { if (ch == asc_BackSpace) { @@ -2634,7 +2640,7 @@ static int strget_(int small,int x,int y,char *t,int dalen,int c) KB_ClearKeyDown(sc_kpad_Enter); return (1); } - else if (ch == asc_Escape || (g_player[myconnectindex].ps.gm&MODE_MENU && MOUSE_GetButtons()&RIGHT_MOUSE)) + else if (ch == asc_Escape || (g_player[myconnectindex].ps->gm&MODE_MENU && MOUSE_GetButtons()&RIGHT_MOUSE)) { KB_ClearKeyDown(sc_Escape); MOUSE_ClearButton(RIGHT_MOUSE); @@ -2661,13 +2667,13 @@ static int strget_(int small,int x,int y,char *t,int dalen,int c) for (ii=0;iigm&MODE_TYPE) x = mpgametext(y,b,c,2+8+16); else x = gametext(x,y,b,c,2+8+16); } else { - if (g_player[myconnectindex].ps.gm&MODE_TYPE) + if (g_player[myconnectindex].ps->gm&MODE_TYPE) x = mpgametext(y,t,c,2+8+16); else x = gametext(x,y,t,c,2+8+16); } @@ -2705,7 +2711,7 @@ static void typemode(void) { short ch, hitstate, i, j, l; - if (g_player[myconnectindex].ps.gm&MODE_SENDTOWHOM) + if (g_player[myconnectindex].ps->gm&MODE_SENDTOWHOM) { if (sendmessagecommand != -1 || ud.multimode < 3 || movesperpacket == 4) { @@ -2727,7 +2733,7 @@ static void typemode(void) i++; } typebuf[i-3] = '\0'; - Bstrcat(recbuf,g_player[myconnectindex].user_name); + Bstrcat(recbuf,g_player[myconnectindex].user_name); } else { @@ -2768,7 +2774,7 @@ static void typemode(void) } sendmessagecommand = -1; - g_player[myconnectindex].ps.gm &= ~(MODE_TYPE|MODE_SENDTOWHOM); + g_player[myconnectindex].ps->gm &= ~(MODE_TYPE|MODE_SENDTOWHOM); } else if (sendmessagecommand == -1) { @@ -2812,7 +2818,7 @@ static void typemode(void) sendmessagecommand = ud.multimode; if (i == 27) { - g_player[myconnectindex].ps.gm &= ~(MODE_TYPE|MODE_SENDTOWHOM); + g_player[myconnectindex].ps->gm &= ~(MODE_TYPE|MODE_SENDTOWHOM); sendmessagecommand = -1; } else @@ -2847,10 +2853,10 @@ static void typemode(void) if (SHIFTS_IS_PRESSED) sendmessagecommand = -1; else sendmessagecommand = ud.multimode; } - g_player[myconnectindex].ps.gm |= MODE_SENDTOWHOM; + g_player[myconnectindex].ps->gm |= MODE_SENDTOWHOM; } else if (hitstate == -1) - g_player[myconnectindex].ps.gm &= ~(MODE_TYPE|MODE_SENDTOWHOM); + g_player[myconnectindex].ps->gm &= ~(MODE_TYPE|MODE_SENDTOWHOM); else pub = NUMPAGES; } } @@ -2865,8 +2871,8 @@ static void moveclouds(void) for (i=0;i>9); - cloudy[i] += (sintable[g_player[screenpeek].ps.ang&2047]>>9); + cloudx[i] += (sintable[(g_player[screenpeek].ps->ang+512)&2047]>>9); + cloudy[i] += (sintable[g_player[screenpeek].ps->ang&2047]>>9); sector[clouds[i]].ceilingxpanning = cloudx[i]>>6; sector[clouds[i]].ceilingypanning = cloudy[i]>>6; @@ -2936,7 +2942,7 @@ static void drawoverheadmap(long cposx, long cposy, long czoom, short cang) } //Draw sprites - k = g_player[screenpeek].ps.i; + k = g_player[screenpeek].ps->i; for (i=0;i>3]&(1<<(i&7)))) continue; @@ -3128,9 +3134,9 @@ static void drawoverheadmap(long cposx, long cposy, long czoom, short cang) { if (ud.scrollmode && p == screenpeek) continue; - ox = sprite[g_player[p].ps.i].x-cposx; - oy = sprite[g_player[p].ps.i].y-cposy; - daang = (sprite[g_player[p].ps.i].ang-cang)&2047; + ox = sprite[g_player[p].ps->i].x-cposx; + oy = sprite[g_player[p].ps->i].y-cposy; + daang = (sprite[g_player[p].ps->i].ang-cang)&2047; if (p == screenpeek) { ox = 0; @@ -3142,20 +3148,20 @@ static void drawoverheadmap(long cposx, long cposy, long czoom, short cang) if (p == screenpeek || GTFLAGS(GAMETYPE_FLAG_OTHERPLAYERSINMAP)) { - if (sprite[g_player[p].ps.i].xvel > 16 && g_player[p].ps.on_ground) + if (sprite[g_player[p].ps->i].xvel > 16 && g_player[p].ps->on_ground) i = APLAYERTOP+((totalclock>>4)&3); else i = APLAYERTOP; - j = klabs(g_player[p].ps.truefz-g_player[p].ps.posz)>>8; - j = mulscale(czoom*(sprite[g_player[p].ps.i].yrepeat+j),yxaspect,16); + j = klabs(g_player[p].ps->truefz-g_player[p].ps->posz)>>8; + j = mulscale(czoom*(sprite[g_player[p].ps->i].yrepeat+j),yxaspect,16); if (j < 22000) j = 22000; else if (j > (65536<<1)) j = (65536<<1); rotatesprite((x1<<4)+(xdim<<15),(y1<<4)+(ydim<<15),j, - daang,i,sprite[g_player[p].ps.i].shade,/*sprite[g_player[p].ps.i].pal*/sector[g_player[p].ps.cursectnum].floorpal, - (sprite[g_player[p].ps.i].cstat&2)>>1,windowx1,windowy1,windowx2,windowy2); + daang,i,sprite[g_player[p].ps->i].shade,/*sprite[g_player[p].ps->i].pal*/sector[g_player[p].ps->cursectnum].floorpal, + (sprite[g_player[p].ps->i].cstat&2)>>1,windowx1,windowy1,windowx2,windowy2); } } } @@ -3167,11 +3173,11 @@ void palto(int r,int g,int b,long e) for(i=0;i<768;i+=3) { temparray[i ] = - g_player[myconnectindex].ps.palette[i+0]+((((long)r-(long)g_player[myconnectindex].ps.palette[i+0])*(long)(e&127))>>6); + g_player[myconnectindex].ps->palette[i+0]+((((long)r-(long)g_player[myconnectindex].ps->palette[i+0])*(long)(e&127))>>6); temparray[i+1] = - g_player[myconnectindex].ps.palette[i+1]+((((long)g-(long)g_player[myconnectindex].ps.palette[i+1])*(long)(e&127))>>6); + g_player[myconnectindex].ps->palette[i+1]+((((long)g-(long)g_player[myconnectindex].ps->palette[i+1])*(long)(e&127))>>6); temparray[i+2] = - g_player[myconnectindex].ps.palette[i+2]+((((long)b-(long)g_player[myconnectindex].ps.palette[i+2])*(long)(e&127))>>6); + g_player[myconnectindex].ps->palette[i+2]+((((long)b-(long)g_player[myconnectindex].ps->palette[i+2])*(long)(e&127))>>6); } */ @@ -3190,7 +3196,7 @@ void displayrest(long smoothratio) long a, i, j; char fader=0,fadeg=0,fadeb=0,fadef=0,tintr=0,tintg=0,tintb=0,tintf=0,dotint=0; - player_struct *pp = &g_player[screenpeek].ps; + player_struct *pp = g_player[screenpeek].ps; walltype *wal; long cposx,cposy,cang; @@ -3387,21 +3393,21 @@ void displayrest(long smoothratio) if (pp->invdisptime > 0) displayinventory(pp); - SetGameVarID(g_iReturnVarID,0,g_player[screenpeek].ps.i,screenpeek); - OnEvent(EVENT_DISPLAYSBAR, g_player[screenpeek].ps.i, screenpeek, -1); - if (GetGameVarID(g_iReturnVarID,g_player[screenpeek].ps.i,screenpeek) == 0) + SetGameVarID(g_iReturnVarID,0,g_player[screenpeek].ps->i,screenpeek); + OnEvent(EVENT_DISPLAYSBAR, g_player[screenpeek].ps->i, screenpeek, -1); + if (GetGameVarID(g_iReturnVarID,g_player[screenpeek].ps->i,screenpeek) == 0) coolgaugetext(screenpeek); operatefta(); if (KB_KeyPressed(sc_Escape) && ud.overhead_on == 0 && ud.show_help == 0 - && g_player[myconnectindex].ps.newowner == -1) + && g_player[myconnectindex].ps->newowner == -1) { - if ((g_player[myconnectindex].ps.gm&MODE_MENU) == MODE_MENU && current_menu < 51) + if ((g_player[myconnectindex].ps->gm&MODE_MENU) == MODE_MENU && current_menu < 51) { KB_ClearKeyDown(sc_Escape); - g_player[myconnectindex].ps.gm &= ~MODE_MENU; + g_player[myconnectindex].ps->gm &= ~MODE_MENU; if (ud.multimode < 2 && ud.recstat != 2) { ready2send = 1; @@ -3412,9 +3418,9 @@ void displayrest(long smoothratio) walock[TILE_SAVESHOT] = 199; vscrn(); } - else if ((g_player[myconnectindex].ps.gm&MODE_MENU) != MODE_MENU && - g_player[myconnectindex].ps.newowner == -1 && - (g_player[myconnectindex].ps.gm&MODE_TYPE) != MODE_TYPE) + else if ((g_player[myconnectindex].ps->gm&MODE_MENU) != MODE_MENU && + g_player[myconnectindex].ps->newowner == -1 && + (g_player[myconnectindex].ps->gm&MODE_TYPE) != MODE_TYPE) { KB_ClearKeyDown(sc_Escape); FX_StopAllSounds(); @@ -3422,43 +3428,43 @@ void displayrest(long smoothratio) intomenusounds(); - g_player[myconnectindex].ps.gm |= MODE_MENU; + g_player[myconnectindex].ps->gm |= MODE_MENU; if (ud.multimode < 2 && ud.recstat != 2) ready2send = 0; - if (g_player[myconnectindex].ps.gm&MODE_GAME) cmenu(50); + if (g_player[myconnectindex].ps->gm&MODE_GAME) cmenu(50); else cmenu(0); screenpeek = myconnectindex; } } - OnEvent(EVENT_DISPLAYREST, g_player[screenpeek].ps.i, screenpeek, -1); + OnEvent(EVENT_DISPLAYREST, g_player[screenpeek].ps->i, screenpeek, -1); - if (g_player[myconnectindex].ps.newowner == -1 && ud.overhead_on == 0 && ud.crosshair && ud.camerasprite == -1) + if (g_player[myconnectindex].ps->newowner == -1 && ud.overhead_on == 0 && ud.crosshair && ud.camerasprite == -1) { - SetGameVarID(g_iReturnVarID,0,g_player[screenpeek].ps.i,screenpeek); - OnEvent(EVENT_DISPLAYCROSSHAIR, g_player[screenpeek].ps.i, screenpeek, -1); - if (GetGameVarID(g_iReturnVarID,g_player[screenpeek].ps.i,screenpeek) == 0) - rotatesprite((160L-(g_player[myconnectindex].ps.look_ang>>1))<<16,100L<<16,ud.crosshair>1?65536L>>(ud.crosshair-1):65536L,0,CROSSHAIR,0,0,2+1,windowx1,windowy1,windowx2,windowy2); + SetGameVarID(g_iReturnVarID,0,g_player[screenpeek].ps->i,screenpeek); + OnEvent(EVENT_DISPLAYCROSSHAIR, g_player[screenpeek].ps->i, screenpeek, -1); + if (GetGameVarID(g_iReturnVarID,g_player[screenpeek].ps->i,screenpeek) == 0) + rotatesprite((160L-(g_player[myconnectindex].ps->look_ang>>1))<<16,100L<<16,ud.crosshair>1?65536L>>(ud.crosshair-1):65536L,0,CROSSHAIR,0,0,2+1,windowx1,windowy1,windowx2,windowy2); } #if 0 if (gametype_flags[ud.coop] & GAMETYPE_FLAG_TDM) { for (i=0;iteam == g_player[myconnectindex].ps->team) { - j = min(max((getincangle(getangle(g_player[i].ps.posx-g_player[myconnectindex].ps.posx,g_player[i].ps.posy-g_player[myconnectindex].ps.posy),g_player[myconnectindex].ps.ang))>>1,-160),160); + j = min(max((getincangle(getangle(g_player[i].ps->posx-g_player[myconnectindex].ps->posx,g_player[i].ps->posy-g_player[myconnectindex].ps->posy),g_player[myconnectindex].ps->ang))>>1,-160),160); rotatesprite((160-j)<<16,100L<<16,65536L,0,DUKEICON,0,0,2+1,windowx1,windowy1,windowx2,windowy2); } } } #endif - if (ud.pause_on==1 && (g_player[myconnectindex].ps.gm&MODE_MENU) == 0) + if (ud.pause_on==1 && (g_player[myconnectindex].ps->gm&MODE_MENU) == 0) menutext(160,100,0,0,"GAME PAUSED"); - if (g_player[myconnectindex].ps.gm&MODE_TYPE) + if (g_player[myconnectindex].ps->gm&MODE_TYPE) typemode(); else menus(); @@ -3471,7 +3477,7 @@ void displayrest(long smoothratio) extern int mdpause; mdpause = 0; - if (ud.pause_on || (g_player[myconnectindex].ps.gm&MODE_MENU && numplayers < 2)) + if (ud.pause_on || (g_player[myconnectindex].ps->gm&MODE_MENU && numplayers < 2)) mdpause = 1; } #endif @@ -3479,24 +3485,24 @@ void displayrest(long smoothratio) tics(); // JBF 20040124: display level stats in screen corner - if (ud.levelstats && (g_player[myconnectindex].ps.gm&MODE_MENU) == 0) + if (ud.levelstats && (g_player[myconnectindex].ps->gm&MODE_MENU) == 0) { i = (ud.screen_size <= 4)?0:scale(tilesizy[BOTTOMSTATUSBAR],ud.statusbarscale,100); Bsprintf(tempbuf,"Time: %ld:%02ld", - (g_player[myconnectindex].ps.player_par/(26*60)), - (g_player[myconnectindex].ps.player_par/26)%60); + (g_player[myconnectindex].ps->player_par/(26*60)), + (g_player[myconnectindex].ps->player_par/26)%60); minitext(320-5*12,200-i-6-6-6,tempbuf,0,26); if (ud.player_skill > 3 || (ud.multimode > 1 && !GTFLAGS(GAMETYPE_FLAG_PLAYERSFRIENDLY))) - Bsprintf(tempbuf,"Kills: %ld",(ud.multimode>1 &&!GTFLAGS(GAMETYPE_FLAG_PLAYERSFRIENDLY))?g_player[i].ps.frag-g_player[i].ps.fraggedself:g_player[myconnectindex].ps.actors_killed); + Bsprintf(tempbuf,"Kills: %ld",(ud.multimode>1 &&!GTFLAGS(GAMETYPE_FLAG_PLAYERSFRIENDLY))?g_player[i].ps->frag-g_player[i].ps->fraggedself:g_player[myconnectindex].ps->actors_killed); else - Bsprintf(tempbuf,"Kills: %ld/%ld",g_player[myconnectindex].ps.actors_killed, - g_player[myconnectindex].ps.max_actors_killed>g_player[myconnectindex].ps.actors_killed? - g_player[myconnectindex].ps.max_actors_killed:g_player[myconnectindex].ps.actors_killed); + Bsprintf(tempbuf,"Kills: %ld/%ld",g_player[myconnectindex].ps->actors_killed, + g_player[myconnectindex].ps->max_actors_killed>g_player[myconnectindex].ps->actors_killed? + g_player[myconnectindex].ps->max_actors_killed:g_player[myconnectindex].ps->actors_killed); minitext(320-5*12,200-i-6-6,tempbuf,0,26); - Bsprintf(tempbuf,"Secrets: %ld/%ld", g_player[myconnectindex].ps.secret_rooms,g_player[myconnectindex].ps.max_secret_rooms); + Bsprintf(tempbuf,"Secrets: %ld/%ld", g_player[myconnectindex].ps->secret_rooms,g_player[myconnectindex].ps->max_secret_rooms); minitext(320-5*12,200-i-6,tempbuf,0,26); } if (tintf > 0 || dotint) palto(tintr,tintg,tintb,tintf|128); @@ -3587,7 +3593,7 @@ void drawbackground(void) y1 = 0; y2 = ydim; - if (g_player[myconnectindex].ps.gm & MODE_GAME || ud.recstat == 2) + if (g_player[myconnectindex].ps->gm & MODE_GAME || ud.recstat == 2) //if (ud.recstat == 0 || ud.recstat == 1 || (ud.recstat == 2 && ud.reccnt > 0)) // JBF 20040717 { if (ud.screen_size == 8 && ud.statusbarmode == 0) @@ -3859,7 +3865,7 @@ void se40code(long x,long y,long z,long a,long h, long smoothratio) case 43: case 44: case 45: - if (g_player[screenpeek].ps.cursectnum == sprite[i].sectnum) + if (g_player[screenpeek].ps->cursectnum == sprite[i].sectnum) SE40_Draw(i,x,y,z,a,h,smoothratio); break; } @@ -3875,7 +3881,7 @@ void displayrooms(int snum,long smoothratio) long dst,j,fz,cz; long tposx,tposy,i; short k; - player_struct *p = &g_player[snum].ps; + player_struct *p = g_player[snum].ps; short tang; long tiltcx,tiltcy,tiltcs=0; // JBF 20030807 #ifdef POLYMOST @@ -3899,7 +3905,7 @@ void displayrooms(int snum,long smoothratio) visibility = p->visibility; - if (ud.pause_on || g_player[snum].ps.on_crane > -1) smoothratio = 65536; + if (ud.pause_on || g_player[snum].ps->on_crane > -1) smoothratio = 65536; ud.camerasect = p->cursectnum; @@ -4059,7 +4065,7 @@ void displayrooms(int snum,long smoothratio) if (ud.camerahoriz > 299) ud.camerahoriz = 299; else if (ud.camerahoriz < -99) ud.camerahoriz = -99; - OnEvent(EVENT_DISPLAYROOMS, g_player[screenpeek].ps.i, screenpeek, -1); + OnEvent(EVENT_DISPLAYROOMS, g_player[screenpeek].ps->i, screenpeek, -1); #ifdef SE40 se40code(ud.camerax,ud.cameray,ud.cameraz,ud.cameraang,ud.camerahoriz,smoothratio); @@ -4197,7 +4203,7 @@ static void dumpdebugdata(void) } DumpGameVars(fp); fclose(fp); - saveboard("debug.map",&g_player[myconnectindex].ps.posx,&g_player[myconnectindex].ps.posy,&g_player[myconnectindex].ps.posz,&g_player[myconnectindex].ps.ang,&g_player[myconnectindex].ps.cursectnum); + saveboard("debug.map",&g_player[myconnectindex].ps->posx,&g_player[myconnectindex].ps->posy,&g_player[myconnectindex].ps->posz,&g_player[myconnectindex].ps->ang,&g_player[myconnectindex].ps->cursectnum); } int EGS(int whatsect,long s_x,long s_y,long s_z,int s_pn,int s_s,int s_xr,int s_yr,int s_a,int s_ve,long s_zv,int s_ow,int s_ss) @@ -4508,7 +4514,7 @@ int spawn(int j, int pn) if (actortype[sp->picnum] & 2) hittype[i].actorstayput = sp->sectnum; - g_player[myconnectindex].ps.max_actors_killed++; + g_player[myconnectindex].ps->max_actors_killed++; sp->clipdist = 80; if (j >= 0) { @@ -4959,7 +4965,7 @@ int spawn(int j, int pn) break; } - sp->cstat = 32+((g_player[sprite[j].yvel].ps.footprintcount&1)<<2); + sp->cstat = 32+((g_player[sprite[j].yvel].ps->footprintcount&1)<<2); sp->ang = sprite[j].ang; } @@ -5013,7 +5019,7 @@ int spawn(int j, int pn) sp->xrepeat = sprite[j].xrepeat; sp->yrepeat = sprite[j].yrepeat; sp->shade = sprite[j].shade; - sp->pal = g_player[sprite[j].yvel].ps.palookup; + sp->pal = g_player[sprite[j].yvel].ps->palookup; } case DUKECAR__STATIC: case HELECOPT__STATIC: @@ -5083,12 +5089,12 @@ int spawn(int j, int pn) if (sprite[j].picnum == APLAYER) { snum = sprite[j].yvel; - a = g_player[snum].ps.ang-(TRAND&63)+8; //Fine tune + a = g_player[snum].ps->ang-(TRAND&63)+8; //Fine tune T1 = TRAND&1; if (sp->picnum == SHOTGUNSHELL) - sp->z = (6<<8)+g_player[snum].ps.pyoff+g_player[snum].ps.posz-((g_player[snum].ps.horizoff+g_player[snum].ps.horiz-100)<<4); - else sp->z = (3<<8)+g_player[snum].ps.pyoff+g_player[snum].ps.posz-((g_player[snum].ps.horizoff+g_player[snum].ps.horiz-100)<<4); + sp->z = (6<<8)+g_player[snum].ps->pyoff+g_player[snum].ps->posz-((g_player[snum].ps->horizoff+g_player[snum].ps->horiz-100)<<4); + else sp->z = (3<<8)+g_player[snum].ps->pyoff+g_player[snum].ps->posz-((g_player[snum].ps->horizoff+g_player[snum].ps->horiz-100)<<4); sp->zvel = -(TRAND&255); } else @@ -5271,7 +5277,7 @@ int spawn(int j, int pn) sp->z -= (18<<8); } else sp->z -= (13<<8); - sp->ang = getangle(g_player[connecthead].ps.posx-sp->x,g_player[connecthead].ps.posy-sp->y); + sp->ang = getangle(g_player[connecthead].ps->posx-sp->x,g_player[connecthead].ps->posy-sp->y); sp->xvel = 48-(TRAND&31); ssp(i,CLIPMASK0); } @@ -5451,7 +5457,7 @@ int spawn(int j, int pn) sp->cstat |= 257; if (sp->picnum != SHARK) - g_player[myconnectindex].ps.max_actors_killed++; + g_player[myconnectindex].ps->max_actors_killed++; } if (sp->picnum == ORGANTIC) sp->cstat |= 128; @@ -5530,7 +5536,7 @@ int spawn(int j, int pn) changespritestat(i,5); return i; } - g_player[myconnectindex].ps.max_actors_killed++; + g_player[myconnectindex].ps->max_actors_killed++; hittype[i].temp_data[5] = 0; if (ud.monsters_off == 1) { @@ -6430,11 +6436,11 @@ void animatesprites(long x,long y,int a,long smoothratio) } if (t->statnum == 99) continue; - if (s->statnum != 1 && s->picnum == APLAYER && g_player[s->yvel].ps.newowner == -1 && s->owner >= 0) + if (s->statnum != 1 && s->picnum == APLAYER && g_player[s->yvel].ps->newowner == -1 && s->owner >= 0) { - t->x -= mulscale16(65536-smoothratio,g_player[s->yvel].ps.posx-g_player[s->yvel].ps.oposx); - t->y -= mulscale16(65536-smoothratio,g_player[s->yvel].ps.posy-g_player[s->yvel].ps.oposy); - t->z = g_player[s->yvel].ps.oposz + mulscale16(smoothratio,g_player[s->yvel].ps.posz-g_player[s->yvel].ps.oposz); + t->x -= mulscale16(65536-smoothratio,g_player[s->yvel].ps->posx-g_player[s->yvel].ps->oposx); + t->y -= mulscale16(65536-smoothratio,g_player[s->yvel].ps->posy-g_player[s->yvel].ps->oposy); + t->z = g_player[s->yvel].ps->oposz + mulscale16(smoothratio,g_player[s->yvel].ps->posz-g_player[s->yvel].ps->oposz); t->z += (40<<8); } else if ((s->statnum == 0 && s->picnum != CRANEPOLE) || s->statnum == 10 || s->statnum == 6 || s->statnum == 4 || s->statnum == 5 || s->statnum == 1) @@ -6489,15 +6495,15 @@ void animatesprites(long x,long y,int a,long smoothratio) sqa = getangle( - sprite[s->owner].x-g_player[screenpeek].ps.posx, - sprite[s->owner].y-g_player[screenpeek].ps.posy); + sprite[s->owner].x-g_player[screenpeek].ps->posx, + sprite[s->owner].y-g_player[screenpeek].ps->posy); sqb = getangle( sprite[s->owner].x-t->x, sprite[s->owner].y-t->y); if (klabs(getincangle(sqa,sqb)) > 512) - if (ldist(&sprite[s->owner],t) < ldist(&sprite[g_player[screenpeek].ps.i],&sprite[s->owner])) + if (ldist(&sprite[s->owner],t) < ldist(&sprite[g_player[screenpeek].ps->i],&sprite[s->owner])) t->xrepeat = t->yrepeat = 0; } continue; @@ -6505,7 +6511,7 @@ void animatesprites(long x,long y,int a,long smoothratio) case BURNING2__STATIC: if (sprite[s->owner].statnum == 10) { - if (display_mirror == 0 && sprite[s->owner].yvel == screenpeek && g_player[sprite[s->owner].yvel].ps.over_shoulder_on == 0) + if (display_mirror == 0 && sprite[s->owner].yvel == screenpeek && g_player[sprite[s->owner].yvel].ps->over_shoulder_on == 0) t->xrepeat = 0; else { @@ -6595,7 +6601,7 @@ void animatesprites(long x,long y,int a,long smoothratio) if (t->pal == 1) t->z -= (18<<8); - if (g_player[p].ps.over_shoulder_on > 0 && g_player[p].ps.newowner < 0) + if (g_player[p].ps->over_shoulder_on > 0 && g_player[p].ps->newowner < 0) { t->cstat |= 2; if (screenpeek == myconnectindex && numplayers >= 2) @@ -6610,7 +6616,7 @@ void animatesprites(long x,long y,int a,long smoothratio) if ((display_mirror || screenpeek != p || s->owner == -1) && ud.multimode > 1) { - if (ud.showweapons && sprite[g_player[p].ps.i].extra > 0 && g_player[p].ps.curr_weapon > 0) + if (ud.showweapons && sprite[g_player[p].ps->i].extra > 0 && g_player[p].ps->curr_weapon > 0) { memcpy((spritetype *)&tsprite[spritesortcnt],(spritetype *)t,sizeof(spritetype)); @@ -6622,10 +6628,10 @@ void animatesprites(long x,long y,int a,long smoothratio) tsprite[spritesortcnt].shade = t->shade; tsprite[spritesortcnt].cstat = 0; - tsprite[spritesortcnt].picnum = (g_player[p].ps.curr_weapon==GROW_WEAPON?GROWSPRITEICON:weapon_sprites[g_player[p].ps.curr_weapon]); + tsprite[spritesortcnt].picnum = (g_player[p].ps->curr_weapon==GROW_WEAPON?GROWSPRITEICON:weapon_sprites[g_player[p].ps->curr_weapon]); if (s->owner >= 0) - tsprite[spritesortcnt].z = g_player[p].ps.posz-(12<<8); + tsprite[spritesortcnt].z = g_player[p].ps->posz-(12<<8); else tsprite[spritesortcnt].z = s->z-(51<<8); if (tsprite[spritesortcnt].picnum == HEAVYHBOMB) { @@ -6641,7 +6647,7 @@ void animatesprites(long x,long y,int a,long smoothratio) spritesortcnt++; } - if (g_player[p].sync.extbits & (1<<7) && !ud.pause_on) + if (g_player[p].sync->extbits & (1<<7) && !ud.pause_on) { memcpy((spritetype *)&tsprite[spritesortcnt],(spritetype *)t,sizeof(spritetype)); @@ -6655,7 +6661,7 @@ void animatesprites(long x,long y,int a,long smoothratio) tsprite[spritesortcnt].picnum = RESPAWNMARKERGREEN; if (s->owner >= 0) - tsprite[spritesortcnt].z = g_player[p].ps.posz-(20<<8); + tsprite[spritesortcnt].z = g_player[p].ps->posz-(20<<8); else tsprite[spritesortcnt].z = s->z-(96<<8); tsprite[spritesortcnt].xrepeat = 32; tsprite[spritesortcnt].yrepeat = 32; @@ -6688,28 +6694,28 @@ void animatesprites(long x,long y,int a,long smoothratio) else if ((hittype[i].floorz-s->z) > (64<<8)) k += 60; t->picnum += k; - t->pal = g_player[p].ps.palookup; + t->pal = g_player[p].ps->palookup; goto PALONLY; } - if (g_player[p].ps.on_crane == -1 && (sector[s->sectnum].lotag&0x7ff) != 1) + if (g_player[p].ps->on_crane == -1 && (sector[s->sectnum].lotag&0x7ff) != 1) { - l = s->z-hittype[g_player[p].ps.i].floorz+(3<<8); + l = s->z-hittype[g_player[p].ps->i].floorz+(3<<8); if (l > 1024 && s->yrepeat > 32 && s->extra > 0) s->yoffset = (signed char)(l/(s->yrepeat<<2)); else s->yoffset=0; } - if (g_player[p].ps.newowner > -1) + if (g_player[p].ps->newowner > -1) { t4 = *(actorscrptr[APLAYER]+1); t3 = 0; t1 = *(actorscrptr[APLAYER]+2); } - if (ud.camerasprite == -1 && g_player[p].ps.newowner == -1) - if (s->owner >= 0 && display_mirror == 0 && g_player[p].ps.over_shoulder_on == 0) + if (ud.camerasprite == -1 && g_player[p].ps->newowner == -1) + if (s->owner >= 0 && display_mirror == 0 && g_player[p].ps->over_shoulder_on == 0) if (ud.multimode < 2 || (ud.multimode > 1 && p == screenpeek)) { t->owner = -1; @@ -6719,7 +6725,7 @@ void animatesprites(long x,long y,int a,long smoothratio) PALONLY: - if (sector[sect].floorpal && sector[sect].floorpal < numl) + if (sector[sect].floorpal && sector[sect].floorpal < g_NumPalettes) t->pal = sector[sect].floorpal; if (s->owner == -1) continue; @@ -6760,7 +6766,7 @@ PALONLY: else t->picnum += T1; t->shade -= 6; - if (sector[sect].floorpal && sector[sect].floorpal < numl) + if (sector[sect].floorpal && sector[sect].floorpal < g_NumPalettes) t->pal = sector[sect].floorpal; break; @@ -6771,7 +6777,7 @@ PALONLY: break; } default: - if (sector[sect].floorpal && sector[sect].floorpal < numl) + if (sector[sect].floorpal && sector[sect].floorpal < g_NumPalettes) t->pal = sector[sect].floorpal; break; } @@ -6861,7 +6867,7 @@ PALONLY: t->cstat |= 4; } - if (g_player[screenpeek].ps.heat_amount > 0 && g_player[screenpeek].ps.heat_on && (badguy(s) || checkspriteflags(t->owner,SPRITE_FLAG_NVG) || s->picnum == APLAYER || s->statnum == 13)) + if (g_player[screenpeek].ps->heat_amount > 0 && g_player[screenpeek].ps->heat_on && (badguy(s) || checkspriteflags(t->owner,SPRITE_FLAG_NVG) || s->picnum == APLAYER || s->statnum == 13)) { t->pal = 6; t->shade = 0; @@ -6886,7 +6892,7 @@ PALONLY: daz = hittype[i].floorz; if ((s->z-daz) < (8<<8)) - if (g_player[screenpeek].ps.posz < daz) + if (g_player[screenpeek].ps->posz < daz) { memcpy((spritetype *)&tsprite[spritesortcnt],(spritetype *)t,sizeof(spritetype)); @@ -6918,8 +6924,8 @@ PALONLY: { int ii; - ii = getangle(tsprite[spritesortcnt].x-g_player[screenpeek].ps.posx, - tsprite[spritesortcnt].y-g_player[screenpeek].ps.posy); + ii = getangle(tsprite[spritesortcnt].x-g_player[screenpeek].ps->posx, + tsprite[spritesortcnt].y-g_player[screenpeek].ps->posy); tsprite[spritesortcnt].x += sintable[(ii+2560)&2047]>>9; tsprite[spritesortcnt].y += sintable[(ii+2048)&2047]>>9; @@ -6935,7 +6941,7 @@ PALONLY: case LASERLINE__STATIC: if (sector[t->sectnum].lotag == 2) t->pal = 8; t->z = sprite[s->owner].z-(3<<8); - if (lasermode == 2 && g_player[screenpeek].ps.heat_on == 0) + if (lasermode == 2 && g_player[screenpeek].ps->heat_on == 0) t->yrepeat = 0; case EXPLOSION2__STATIC: case EXPLOSION2BOT__STATIC: @@ -6950,7 +6956,7 @@ PALONLY: case FLOORFLAME__STATIC: if (t->picnum == EXPLOSION2) { - g_player[screenpeek].ps.visibility = -127; + g_player[screenpeek].ps->visibility = -127; lastvisinc = totalclock+32; //restorepalette = 1; // JBF 20040101: why? } @@ -7128,68 +7134,68 @@ enum cheats void CheatGetInventory(void) { - SetGameVarID(g_iReturnVarID, 400, g_player[myconnectindex].ps.i, myconnectindex); - OnEvent(EVENT_CHEATGETSTEROIDS, g_player[myconnectindex].ps.i, myconnectindex, -1); - if (GetGameVarID(g_iReturnVarID, g_player[myconnectindex].ps.i, myconnectindex) >=0) + SetGameVarID(g_iReturnVarID, 400, g_player[myconnectindex].ps->i, myconnectindex); + OnEvent(EVENT_CHEATGETSTEROIDS, g_player[myconnectindex].ps->i, myconnectindex, -1); + if (GetGameVarID(g_iReturnVarID, g_player[myconnectindex].ps->i, myconnectindex) >=0) { - g_player[myconnectindex].ps.steroids_amount = - GetGameVarID(g_iReturnVarID, g_player[myconnectindex].ps.i, myconnectindex); + g_player[myconnectindex].ps->steroids_amount = + GetGameVarID(g_iReturnVarID, g_player[myconnectindex].ps->i, myconnectindex); } - SetGameVarID(g_iReturnVarID, 1200, g_player[myconnectindex].ps.i, myconnectindex); - OnEvent(EVENT_CHEATGETHEAT, g_player[myconnectindex].ps.i, myconnectindex, -1); - if (GetGameVarID(g_iReturnVarID, g_player[myconnectindex].ps.i, myconnectindex) >=0) + SetGameVarID(g_iReturnVarID, 1200, g_player[myconnectindex].ps->i, myconnectindex); + OnEvent(EVENT_CHEATGETHEAT, g_player[myconnectindex].ps->i, myconnectindex, -1); + if (GetGameVarID(g_iReturnVarID, g_player[myconnectindex].ps->i, myconnectindex) >=0) { - g_player[myconnectindex].ps.heat_amount = - GetGameVarID(g_iReturnVarID, g_player[myconnectindex].ps.i, myconnectindex); + g_player[myconnectindex].ps->heat_amount = + GetGameVarID(g_iReturnVarID, g_player[myconnectindex].ps->i, myconnectindex); } - SetGameVarID(g_iReturnVarID, 200, g_player[myconnectindex].ps.i, myconnectindex); - OnEvent(EVENT_CHEATGETBOOT, g_player[myconnectindex].ps.i, myconnectindex, -1); - if (GetGameVarID(g_iReturnVarID, g_player[myconnectindex].ps.i, myconnectindex) >=0) + SetGameVarID(g_iReturnVarID, 200, g_player[myconnectindex].ps->i, myconnectindex); + OnEvent(EVENT_CHEATGETBOOT, g_player[myconnectindex].ps->i, myconnectindex, -1); + if (GetGameVarID(g_iReturnVarID, g_player[myconnectindex].ps->i, myconnectindex) >=0) { - g_player[myconnectindex].ps.boot_amount = - GetGameVarID(g_iReturnVarID, g_player[myconnectindex].ps.i, myconnectindex); + g_player[myconnectindex].ps->boot_amount = + GetGameVarID(g_iReturnVarID, g_player[myconnectindex].ps->i, myconnectindex); } - SetGameVarID(g_iReturnVarID, 100, g_player[myconnectindex].ps.i, myconnectindex); - OnEvent(EVENT_CHEATGETSHIELD, g_player[myconnectindex].ps.i, myconnectindex, -1); - if (GetGameVarID(g_iReturnVarID, g_player[myconnectindex].ps.i, myconnectindex) >=0) + SetGameVarID(g_iReturnVarID, 100, g_player[myconnectindex].ps->i, myconnectindex); + OnEvent(EVENT_CHEATGETSHIELD, g_player[myconnectindex].ps->i, myconnectindex, -1); + if (GetGameVarID(g_iReturnVarID, g_player[myconnectindex].ps->i, myconnectindex) >=0) { - g_player[myconnectindex].ps.shield_amount = - GetGameVarID(g_iReturnVarID, g_player[myconnectindex].ps.i, myconnectindex); + g_player[myconnectindex].ps->shield_amount = + GetGameVarID(g_iReturnVarID, g_player[myconnectindex].ps->i, myconnectindex); } - SetGameVarID(g_iReturnVarID, 6400, g_player[myconnectindex].ps.i, myconnectindex); - OnEvent(EVENT_CHEATGETSCUBA, g_player[myconnectindex].ps.i, myconnectindex, -1); - if (GetGameVarID(g_iReturnVarID, g_player[myconnectindex].ps.i, myconnectindex) >=0) + SetGameVarID(g_iReturnVarID, 6400, g_player[myconnectindex].ps->i, myconnectindex); + OnEvent(EVENT_CHEATGETSCUBA, g_player[myconnectindex].ps->i, myconnectindex, -1); + if (GetGameVarID(g_iReturnVarID, g_player[myconnectindex].ps->i, myconnectindex) >=0) { - g_player[myconnectindex].ps.scuba_amount = - GetGameVarID(g_iReturnVarID, g_player[myconnectindex].ps.i, myconnectindex); + g_player[myconnectindex].ps->scuba_amount = + GetGameVarID(g_iReturnVarID, g_player[myconnectindex].ps->i, myconnectindex); } - SetGameVarID(g_iReturnVarID, 2400, g_player[myconnectindex].ps.i, myconnectindex); - OnEvent(EVENT_CHEATGETHOLODUKE, g_player[myconnectindex].ps.i, myconnectindex, -1); - if (GetGameVarID(g_iReturnVarID, g_player[myconnectindex].ps.i, myconnectindex) >=0) + SetGameVarID(g_iReturnVarID, 2400, g_player[myconnectindex].ps->i, myconnectindex); + OnEvent(EVENT_CHEATGETHOLODUKE, g_player[myconnectindex].ps->i, myconnectindex, -1); + if (GetGameVarID(g_iReturnVarID, g_player[myconnectindex].ps->i, myconnectindex) >=0) { - g_player[myconnectindex].ps.holoduke_amount = - GetGameVarID(g_iReturnVarID, g_player[myconnectindex].ps.i, myconnectindex); + g_player[myconnectindex].ps->holoduke_amount = + GetGameVarID(g_iReturnVarID, g_player[myconnectindex].ps->i, myconnectindex); } - SetGameVarID(g_iReturnVarID, 1600, g_player[myconnectindex].ps.i, myconnectindex); - OnEvent(EVENT_CHEATGETJETPACK, g_player[myconnectindex].ps.i, myconnectindex, -1); - if (GetGameVarID(g_iReturnVarID, g_player[myconnectindex].ps.i, myconnectindex) >=0) + SetGameVarID(g_iReturnVarID, 1600, g_player[myconnectindex].ps->i, myconnectindex); + OnEvent(EVENT_CHEATGETJETPACK, g_player[myconnectindex].ps->i, myconnectindex, -1); + if (GetGameVarID(g_iReturnVarID, g_player[myconnectindex].ps->i, myconnectindex) >=0) { - g_player[myconnectindex].ps.jetpack_amount = - GetGameVarID(g_iReturnVarID, g_player[myconnectindex].ps.i, myconnectindex); + g_player[myconnectindex].ps->jetpack_amount = + GetGameVarID(g_iReturnVarID, g_player[myconnectindex].ps->i, myconnectindex); } - SetGameVarID(g_iReturnVarID, max_player_health, g_player[myconnectindex].ps.i, myconnectindex); - OnEvent(EVENT_CHEATGETFIRSTAID, g_player[myconnectindex].ps.i, myconnectindex, -1); - if (GetGameVarID(g_iReturnVarID, g_player[myconnectindex].ps.i, myconnectindex) >=0) + SetGameVarID(g_iReturnVarID, max_player_health, g_player[myconnectindex].ps->i, myconnectindex); + OnEvent(EVENT_CHEATGETFIRSTAID, g_player[myconnectindex].ps->i, myconnectindex, -1); + if (GetGameVarID(g_iReturnVarID, g_player[myconnectindex].ps->i, myconnectindex) >=0) { - g_player[myconnectindex].ps.firstaid_amount = - GetGameVarID(g_iReturnVarID, g_player[myconnectindex].ps.i, myconnectindex); + g_player[myconnectindex].ps->firstaid_amount = + GetGameVarID(g_iReturnVarID, g_player[myconnectindex].ps->i, myconnectindex); } } @@ -7209,7 +7215,7 @@ static void cheats(void) consolecheat = 1; } - if ((g_player[myconnectindex].ps.gm&MODE_TYPE) || (g_player[myconnectindex].ps.gm&MODE_MENU)) + if ((g_player[myconnectindex].ps->gm&MODE_TYPE) || (g_player[myconnectindex].ps->gm&MODE_MENU)) return; if (VOLUMEONE && !z) @@ -7222,7 +7228,7 @@ static void cheats(void) if (consolecheat && numplayers < 2 && ud.recstat == 0) goto FOUNDCHEAT; - if (g_player[myconnectindex].ps.cheat_phase == 1) + if (g_player[myconnectindex].ps->cheat_phase == 1) { while (KB_KeyWaiting()) { @@ -7230,8 +7236,8 @@ static void cheats(void) if (!((ch >= 'a' && ch <= 'z') || (ch >= '0' && ch <= '9'))) { - g_player[myconnectindex].ps.cheat_phase = 0; - // FTA(46,&g_player[myconnectindex].ps); + g_player[myconnectindex].ps->cheat_phase = 0; + // FTA(46,g_player[myconnectindex].ps); return; } @@ -7241,7 +7247,7 @@ static void cheats(void) if (cheatbuflen > MAXCHEATLEN) { - g_player[myconnectindex].ps.cheat_phase = 0; + g_player[myconnectindex].ps->cheat_phase = 0; return; } @@ -7258,7 +7264,7 @@ static void cheats(void) } } - g_player[myconnectindex].ps.cheat_phase = 0; + g_player[myconnectindex].ps->cheat_phase = 0; return; FOUNDCHEAT: @@ -7274,34 +7280,34 @@ FOUNDCHEAT: for (weapon = PISTOL_WEAPON;weapon < MAX_WEAPONS-j;weapon++) { - addammo(weapon, &g_player[myconnectindex].ps, max_ammo_amount[weapon]); - g_player[myconnectindex].ps.gotweapon[weapon] = 1; + addammo(weapon, g_player[myconnectindex].ps, max_ammo_amount[weapon]); + g_player[myconnectindex].ps->gotweapon[weapon] = 1; } KB_FlushKeyBoardQueue(); - g_player[myconnectindex].ps.cheat_phase = 0; - FTA(119,&g_player[myconnectindex].ps); + g_player[myconnectindex].ps->cheat_phase = 0; + FTA(119,g_player[myconnectindex].ps); return; case CHEAT_INVENTORY: KB_FlushKeyBoardQueue(); - g_player[myconnectindex].ps.cheat_phase = 0; + g_player[myconnectindex].ps->cheat_phase = 0; CheatGetInventory(); - FTA(120,&g_player[myconnectindex].ps); - g_player[myconnectindex].ps.cheat_phase = 0; + FTA(120,g_player[myconnectindex].ps); + g_player[myconnectindex].ps->cheat_phase = 0; return; case CHEAT_KEYS: - g_player[myconnectindex].ps.got_access = 7; + g_player[myconnectindex].ps->got_access = 7; KB_FlushKeyBoardQueue(); - g_player[myconnectindex].ps.cheat_phase = 0; - FTA(121,&g_player[myconnectindex].ps); + g_player[myconnectindex].ps->cheat_phase = 0; + FTA(121,g_player[myconnectindex].ps); return; case CHEAT_DEBUG: debug_on = 1-debug_on; KB_FlushKeyBoardQueue(); - g_player[myconnectindex].ps.cheat_phase = 0; + g_player[myconnectindex].ps->cheat_phase = 0; dumpdebugdata(); Bsprintf(tempbuf,"GAMEVARS DUMPED TO DEBUG.CON"); @@ -7313,19 +7319,19 @@ FOUNDCHEAT: case CHEAT_CLIP: ud.clipping = 1-ud.clipping; KB_FlushKeyBoardQueue(); - g_player[myconnectindex].ps.cheat_phase = 0; - FTA(112+ud.clipping,&g_player[myconnectindex].ps); + g_player[myconnectindex].ps->cheat_phase = 0; + FTA(112+ud.clipping,g_player[myconnectindex].ps); return; case CHEAT_RESERVED2: - g_player[myconnectindex].ps.gm = MODE_EOL; - g_player[myconnectindex].ps.cheat_phase = 0; + g_player[myconnectindex].ps->gm = MODE_EOL; + g_player[myconnectindex].ps->cheat_phase = 0; KB_FlushKeyBoardQueue(); return; case CHEAT_ALLEN: - FTA(79,&g_player[myconnectindex].ps); - g_player[myconnectindex].ps.cheat_phase = 0; + FTA(79,g_player[myconnectindex].ps); + g_player[myconnectindex].ps->cheat_phase = 0; KB_ClearKeyDown(sc_N); return; @@ -7337,33 +7343,33 @@ FOUNDCHEAT: { pus = 1; pub = 1; - sprite[g_player[myconnectindex].ps.i].cstat = 257; + sprite[g_player[myconnectindex].ps->i].cstat = 257; - hittype[g_player[myconnectindex].ps.i].temp_data[0] = 0; - hittype[g_player[myconnectindex].ps.i].temp_data[1] = 0; - hittype[g_player[myconnectindex].ps.i].temp_data[2] = 0; - hittype[g_player[myconnectindex].ps.i].temp_data[3] = 0; - hittype[g_player[myconnectindex].ps.i].temp_data[4] = 0; - hittype[g_player[myconnectindex].ps.i].temp_data[5] = 0; + hittype[g_player[myconnectindex].ps->i].temp_data[0] = 0; + hittype[g_player[myconnectindex].ps->i].temp_data[1] = 0; + hittype[g_player[myconnectindex].ps->i].temp_data[2] = 0; + hittype[g_player[myconnectindex].ps->i].temp_data[3] = 0; + hittype[g_player[myconnectindex].ps->i].temp_data[4] = 0; + hittype[g_player[myconnectindex].ps->i].temp_data[5] = 0; - sprite[g_player[myconnectindex].ps.i].hitag = 0; - sprite[g_player[myconnectindex].ps.i].lotag = 0; - sprite[g_player[myconnectindex].ps.i].pal = g_player[myconnectindex].ps.palookup; + sprite[g_player[myconnectindex].ps->i].hitag = 0; + sprite[g_player[myconnectindex].ps->i].lotag = 0; + sprite[g_player[myconnectindex].ps->i].pal = g_player[myconnectindex].ps->palookup; - FTA(17,&g_player[myconnectindex].ps); + FTA(17,g_player[myconnectindex].ps); } else { ud.god = 0; - sprite[g_player[myconnectindex].ps.i].extra = max_player_health; - hittype[g_player[myconnectindex].ps.i].extra = -1; - g_player[myconnectindex].ps.last_extra = max_player_health; - FTA(18,&g_player[myconnectindex].ps); + sprite[g_player[myconnectindex].ps->i].extra = max_player_health; + hittype[g_player[myconnectindex].ps->i].extra = -1; + g_player[myconnectindex].ps->last_extra = max_player_health; + FTA(18,g_player[myconnectindex].ps); } - sprite[g_player[myconnectindex].ps.i].extra = max_player_health; - hittype[g_player[myconnectindex].ps.i].extra = 0; - g_player[myconnectindex].ps.cheat_phase = 0; + sprite[g_player[myconnectindex].ps->i].extra = max_player_health; + hittype[g_player[myconnectindex].ps->i].extra = 0; + g_player[myconnectindex].ps->cheat_phase = 0; KB_FlushKeyBoardQueue(); return; @@ -7374,41 +7380,41 @@ FOUNDCHEAT: { pus = 1; pub = 1; - sprite[g_player[myconnectindex].ps.i].cstat = 257; + sprite[g_player[myconnectindex].ps->i].cstat = 257; - hittype[g_player[myconnectindex].ps.i].temp_data[0] = 0; - hittype[g_player[myconnectindex].ps.i].temp_data[1] = 0; - hittype[g_player[myconnectindex].ps.i].temp_data[2] = 0; - hittype[g_player[myconnectindex].ps.i].temp_data[3] = 0; - hittype[g_player[myconnectindex].ps.i].temp_data[4] = 0; - hittype[g_player[myconnectindex].ps.i].temp_data[5] = 0; + hittype[g_player[myconnectindex].ps->i].temp_data[0] = 0; + hittype[g_player[myconnectindex].ps->i].temp_data[1] = 0; + hittype[g_player[myconnectindex].ps->i].temp_data[2] = 0; + hittype[g_player[myconnectindex].ps->i].temp_data[3] = 0; + hittype[g_player[myconnectindex].ps->i].temp_data[4] = 0; + hittype[g_player[myconnectindex].ps->i].temp_data[5] = 0; - sprite[g_player[myconnectindex].ps.i].hitag = 0; - sprite[g_player[myconnectindex].ps.i].lotag = 0; - sprite[g_player[myconnectindex].ps.i].pal = g_player[myconnectindex].ps.palookup; + sprite[g_player[myconnectindex].ps->i].hitag = 0; + sprite[g_player[myconnectindex].ps->i].lotag = 0; + sprite[g_player[myconnectindex].ps->i].pal = g_player[myconnectindex].ps->palookup; Bstrcpy(fta_quotes[122],"Scream for me, Long Beach!"); - FTA(122,&g_player[myconnectindex].ps); + FTA(122,g_player[myconnectindex].ps); CheatGetInventory(); for (weapon = PISTOL_WEAPON;weapon < MAX_WEAPONS;weapon++) - g_player[myconnectindex].ps.gotweapon[weapon] = 1; + g_player[myconnectindex].ps->gotweapon[weapon] = 1; for (weapon = PISTOL_WEAPON; weapon < (MAX_WEAPONS); weapon++) - addammo(weapon, &g_player[myconnectindex].ps, max_ammo_amount[weapon]); - g_player[myconnectindex].ps.got_access = 7; + addammo(weapon, g_player[myconnectindex].ps, max_ammo_amount[weapon]); + g_player[myconnectindex].ps->got_access = 7; } else { - sprite[g_player[myconnectindex].ps.i].extra = max_player_health; - hittype[g_player[myconnectindex].ps.i].extra = -1; - g_player[myconnectindex].ps.last_extra = max_player_health; - FTA(18,&g_player[myconnectindex].ps); + sprite[g_player[myconnectindex].ps->i].extra = max_player_health; + hittype[g_player[myconnectindex].ps->i].extra = -1; + g_player[myconnectindex].ps->last_extra = max_player_health; + FTA(18,g_player[myconnectindex].ps); } - sprite[g_player[myconnectindex].ps.i].extra = max_player_health; - hittype[g_player[myconnectindex].ps.i].extra = 0; - g_player[myconnectindex].ps.cheat_phase = 0; + sprite[g_player[myconnectindex].ps->i].extra = max_player_health; + hittype[g_player[myconnectindex].ps->i].extra = 0; + g_player[myconnectindex].ps->cheat_phase = 0; KB_FlushKeyBoardQueue(); Bstrcpy(terminx,terminx); return; @@ -7421,21 +7427,21 @@ FOUNDCHEAT: j = 6; for (weapon = PISTOL_WEAPON;weapon < MAX_WEAPONS-j;weapon++) - g_player[myconnectindex].ps.gotweapon[weapon] = 1; + g_player[myconnectindex].ps->gotweapon[weapon] = 1; for (weapon = PISTOL_WEAPON; weapon < (MAX_WEAPONS-j); weapon++) - addammo(weapon, &g_player[myconnectindex].ps, max_ammo_amount[weapon]); + addammo(weapon, g_player[myconnectindex].ps, max_ammo_amount[weapon]); CheatGetInventory(); - g_player[myconnectindex].ps.got_access = 7; - FTA(5,&g_player[myconnectindex].ps); - g_player[myconnectindex].ps.cheat_phase = 0; + g_player[myconnectindex].ps->got_access = 7; + FTA(5,g_player[myconnectindex].ps); + g_player[myconnectindex].ps->cheat_phase = 0; - // FTA(21,&g_player[myconnectindex].ps); - g_player[myconnectindex].ps.cheat_phase = 0; + // FTA(21,g_player[myconnectindex].ps); + g_player[myconnectindex].ps->cheat_phase = 0; KB_FlushKeyBoardQueue(); - g_player[myconnectindex].ps.inven_icon = 1; + g_player[myconnectindex].ps->inven_icon = 1; return; case CHEAT_SCOTTY: @@ -7464,7 +7470,7 @@ FOUNDCHEAT: if ((VOLUMEONE && volnume > 0) || volnume > num_volumes-1 || levnume >= MAXLEVELS || map[volnume*MAXLEVELS+levnume].filename == NULL) { - g_player[myconnectindex].ps.cheat_phase = 0; + g_player[myconnectindex].ps->cheat_phase = 0; KB_FlushKeyBoardQueue(); return; } @@ -7486,36 +7492,36 @@ FOUNDCHEAT: } if (numplayers > 1 && myconnectindex == connecthead) mpchangemap(ud.m_volume_number,ud.m_level_number); - else g_player[myconnectindex].ps.gm |= MODE_RESTART; + else g_player[myconnectindex].ps->gm |= MODE_RESTART; - g_player[myconnectindex].ps.cheat_phase = 0; + g_player[myconnectindex].ps->cheat_phase = 0; KB_FlushKeyBoardQueue(); return; case CHEAT_COORDS: - g_player[myconnectindex].ps.cheat_phase = 0; + g_player[myconnectindex].ps->cheat_phase = 0; ud.coords = 1-ud.coords; KB_FlushKeyBoardQueue(); return; case CHEAT_VIEW: - if (g_player[myconnectindex].ps.over_shoulder_on) - g_player[myconnectindex].ps.over_shoulder_on = 0; + if (g_player[myconnectindex].ps->over_shoulder_on) + g_player[myconnectindex].ps->over_shoulder_on = 0; else { - g_player[myconnectindex].ps.over_shoulder_on = 1; + g_player[myconnectindex].ps->over_shoulder_on = 1; cameradist = 0; cameraclock = totalclock; } - FTA(22,&g_player[myconnectindex].ps); - g_player[myconnectindex].ps.cheat_phase = 0; + FTA(22,g_player[myconnectindex].ps); + g_player[myconnectindex].ps->cheat_phase = 0; KB_FlushKeyBoardQueue(); return; case CHEAT_TIME: - FTA(21,&g_player[myconnectindex].ps); - g_player[myconnectindex].ps.cheat_phase = 0; + FTA(21,g_player[myconnectindex].ps); + g_player[myconnectindex].ps->cheat_phase = 0; KB_FlushKeyBoardQueue(); return; @@ -7530,27 +7536,27 @@ FOUNDCHEAT: { if (j&(0xffff-16384)) sector[i].lotag &= (0xffff-16384); - operatesectors(i,g_player[myconnectindex].ps.i); + operatesectors(i,g_player[myconnectindex].ps->i); } } - operateforcefields(g_player[myconnectindex].ps.i,-1); + operateforcefields(g_player[myconnectindex].ps->i,-1); - FTA(100,&g_player[myconnectindex].ps); - g_player[myconnectindex].ps.cheat_phase = 0; + FTA(100,g_player[myconnectindex].ps); + g_player[myconnectindex].ps->cheat_phase = 0; KB_FlushKeyBoardQueue(); return; case CHEAT_CASHMAN: ud.cashman = 1-ud.cashman; KB_ClearKeyDown(sc_N); - g_player[myconnectindex].ps.cheat_phase = 0; + g_player[myconnectindex].ps->cheat_phase = 0; return; case CHEAT_ITEMS: CheatGetInventory(); - g_player[myconnectindex].ps.got_access = 7; - FTA(5,&g_player[myconnectindex].ps); - g_player[myconnectindex].ps.cheat_phase = 0; + g_player[myconnectindex].ps->got_access = 7; + FTA(5,g_player[myconnectindex].ps); + g_player[myconnectindex].ps->cheat_phase = 0; KB_FlushKeyBoardQueue(); return; @@ -7562,7 +7568,7 @@ FOUNDCHEAT: show2dsector[i] = 255; for (i=0;i<(MAXWALLS>>3);i++) show2dwall[i] = 255; - FTA(111,&g_player[myconnectindex].ps); + FTA(111,g_player[myconnectindex].ps); } else { @@ -7570,36 +7576,36 @@ FOUNDCHEAT: show2dsector[i] = 0; for (i=0;i<(MAXWALLS>>3);i++) show2dwall[i] = 0; - FTA(1,&g_player[myconnectindex].ps); + FTA(1,g_player[myconnectindex].ps); } - g_player[myconnectindex].ps.cheat_phase = 0; + g_player[myconnectindex].ps->cheat_phase = 0; KB_FlushKeyBoardQueue(); return; case CHEAT_TODD: - FTA(99,&g_player[myconnectindex].ps); - g_player[myconnectindex].ps.cheat_phase = 0; + FTA(99,g_player[myconnectindex].ps); + g_player[myconnectindex].ps->cheat_phase = 0; KB_FlushKeyBoardQueue(); return; case CHEAT_RATE: ud.tickrate = !ud.tickrate; - g_player[myconnectindex].ps.cheat_phase = 0; + g_player[myconnectindex].ps->cheat_phase = 0; KB_FlushKeyBoardQueue(); return; case CHEAT_BETA: - FTA(105,&g_player[myconnectindex].ps); + FTA(105,g_player[myconnectindex].ps); KB_ClearKeyDown(sc_H); - g_player[myconnectindex].ps.cheat_phase = 0; + g_player[myconnectindex].ps->cheat_phase = 0; KB_FlushKeyBoardQueue(); return; case CHEAT_HYPER: - g_player[myconnectindex].ps.steroids_amount = 399; - g_player[myconnectindex].ps.heat_amount = 1200; - g_player[myconnectindex].ps.cheat_phase = 0; - FTA(37,&g_player[myconnectindex].ps); + g_player[myconnectindex].ps->steroids_amount = 399; + g_player[myconnectindex].ps->heat_amount = 1200; + g_player[myconnectindex].ps->cheat_phase = 0; + FTA(37,g_player[myconnectindex].ps); KB_FlushKeyBoardQueue(); return; @@ -7609,16 +7615,16 @@ FOUNDCHEAT: actor_tog++; if (actor_tog == 3) actor_tog = 0; - g_player[screenpeek].ps.cheat_phase = 0; + g_player[screenpeek].ps->cheat_phase = 0; Bsprintf(fta_quotes[122],"MONSTERS: %s",s[(unsigned char)actor_tog]); - FTA(122,&g_player[myconnectindex].ps); + FTA(122,g_player[myconnectindex].ps); KB_FlushKeyBoardQueue(); return; } case CHEAT_RESERVED: case CHEAT_RESERVED3: ud.eog = 1; - g_player[myconnectindex].ps.gm |= MODE_EOL; + g_player[myconnectindex].ps->gm |= MODE_EOL; KB_FlushKeyBoardQueue(); return; } @@ -7629,34 +7635,34 @@ FOUNDCHEAT: { if (KB_KeyPressed((unsigned char)cheatkey[0])) { - if (g_player[myconnectindex].ps.cheat_phase >= 0 && numplayers < 2 && ud.recstat == 0) + if (g_player[myconnectindex].ps->cheat_phase >= 0 && numplayers < 2 && ud.recstat == 0) { if (cheatkey[0] == cheatkey[1]) KB_ClearKeyDown((unsigned char)cheatkey[0]); - g_player[myconnectindex].ps.cheat_phase = -1; + g_player[myconnectindex].ps->cheat_phase = -1; } } if (KB_KeyPressed((unsigned char)cheatkey[1])) { - if (g_player[myconnectindex].ps.cheat_phase == -1) + if (g_player[myconnectindex].ps->cheat_phase == -1) { if (ud.player_skill == 4) { - FTA(22,&g_player[myconnectindex].ps); - g_player[myconnectindex].ps.cheat_phase = 0; + FTA(22,g_player[myconnectindex].ps); + g_player[myconnectindex].ps->cheat_phase = 0; } else { - g_player[myconnectindex].ps.cheat_phase = 1; - // FTA(25,&g_player[myconnectindex].ps); + g_player[myconnectindex].ps->cheat_phase = 1; + // FTA(25,g_player[myconnectindex].ps); cheatbuflen = 0; } KB_FlushKeyboardQueue(); } - else if (g_player[myconnectindex].ps.cheat_phase != 0) + else if (g_player[myconnectindex].ps->cheat_phase != 0) { - g_player[myconnectindex].ps.cheat_phase = 0; + g_player[myconnectindex].ps->cheat_phase = 0; KB_ClearKeyDown((unsigned char)cheatkey[0]); KB_ClearKeyDown((unsigned char)cheatkey[1]); } @@ -7675,7 +7681,7 @@ static void nonsharedkeys(void) CONTROL_GetInput(&noshareinfo); } - if (gotvote[myconnectindex] == 0 && voting != -1 && voting != myconnectindex) + if (g_player[myconnectindex].gotvote == 0 && voting != -1 && voting != myconnectindex) { if (KB_KeyPressed(sc_F1) || KB_KeyPressed(sc_F2) || ud.autovote) { @@ -7690,14 +7696,14 @@ static void nonsharedkeys(void) if ((!networkmode) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master } adduserquote("VOTE CAST"); - gotvote[myconnectindex] = 1; + g_player[myconnectindex].gotvote = 1; KB_ClearKeyDown(sc_F1); KB_ClearKeyDown(sc_F2); voting = -1; } } - if (!ALT_IS_PRESSED && ud.overhead_on == 0 && (g_player[myconnectindex].ps.gm & MODE_TYPE) == 0) + if (!ALT_IS_PRESSED && ud.overhead_on == 0 && (g_player[myconnectindex].ps->gm & MODE_TYPE) == 0) { if (BUTTON(gamefunc_Enlarge_Screen)) { @@ -7745,7 +7751,7 @@ static void nonsharedkeys(void) } } - if (g_player[myconnectindex].ps.cheat_phase == 1 || (g_player[myconnectindex].ps.gm&(MODE_MENU|MODE_TYPE))) return; + if (g_player[myconnectindex].ps->cheat_phase == 1 || (g_player[myconnectindex].ps->gm&(MODE_MENU|MODE_TYPE))) return; if (BUTTON(gamefunc_See_Coop_View) && (GTFLAGS(GAMETYPE_FLAG_COOPVIEW) || ud.recstat == 2)) { @@ -7760,14 +7766,14 @@ static void nonsharedkeys(void) CONTROL_ClearButton(gamefunc_Show_Opponents_Weapon); ud.showweapons = 1-ud.showweapons; ud.config.ShowOpponentWeapons = ud.showweapons; - FTA(82-ud.showweapons,&g_player[screenpeek].ps); + FTA(82-ud.showweapons,g_player[screenpeek].ps); } if (BUTTON(gamefunc_Toggle_Crosshair)) { CONTROL_ClearButton(gamefunc_Toggle_Crosshair); ud.crosshair = (ud.crosshair==3)?0:ud.crosshair+1; - FTA(ud.crosshair?20:21,&g_player[screenpeek].ps); + FTA(ud.crosshair?20:21,g_player[screenpeek].ps); } if (ud.overhead_on && BUTTON(gamefunc_Map_Follow_Mode)) @@ -7776,11 +7782,11 @@ static void nonsharedkeys(void) ud.scrollmode = 1-ud.scrollmode; if (ud.scrollmode) { - ud.folx = g_player[screenpeek].ps.oposx; - ud.foly = g_player[screenpeek].ps.oposy; - ud.fola = g_player[screenpeek].ps.oang; + ud.folx = g_player[screenpeek].ps->oposx; + ud.foly = g_player[screenpeek].ps->oposy; + ud.fola = g_player[screenpeek].ps->oang; } - FTA(83+ud.scrollmode,&g_player[myconnectindex].ps); + FTA(83+ud.scrollmode,g_player[myconnectindex].ps); } if (SHIFTS_IS_PRESSED || ALT_IS_PRESSED) @@ -7841,7 +7847,7 @@ static void nonsharedkeys(void) { if (SHIFTS_IS_PRESSED) { - if (i == 5 && g_player[myconnectindex].ps.fta > 0 && g_player[myconnectindex].ps.ftq == 26) + if (i == 5 && g_player[myconnectindex].ps->fta > 0 && g_player[myconnectindex].ps->ftq == 26) { i = (VOLUMEALL?MAXVOLUMES*MAXLEVELS:6); music_select++; @@ -7852,7 +7858,7 @@ static void nonsharedkeys(void) if (map[(unsigned char)music_select].musicfn != NULL) { Bsprintf(fta_quotes[26],"PLAYING %s",&map[(unsigned char)music_select].musicfn[0]); - FTA(26,&g_player[myconnectindex].ps); + FTA(26,g_player[myconnectindex].ps); playmusic(&map[(unsigned char)music_select].musicfn[0]); } return; @@ -7920,7 +7926,7 @@ static void nonsharedkeys(void) { KB_FlushKeyboardQueue(); CONTROL_ClearButton(gamefunc_SendMessage); - g_player[myconnectindex].ps.gm |= MODE_TYPE; + g_player[myconnectindex].ps->gm |= MODE_TYPE; typebuf[0] = 0; inputloc = 0; } @@ -7961,9 +7967,9 @@ static void nonsharedkeys(void) return; FAKE_F2: - if (sprite[g_player[myconnectindex].ps.i].extra <= 0) + if (sprite[g_player[myconnectindex].ps->i].extra <= 0) { - FTA(118,&g_player[myconnectindex].ps); + FTA(118,g_player[myconnectindex].ps); return; } cmenu(350); @@ -7975,7 +7981,7 @@ FAKE_F2: clearsoundlocks(); // setview(0,0,xdim-1,ydim-1); - g_player[myconnectindex].ps.gm |= MODE_MENU; + g_player[myconnectindex].ps->gm |= MODE_MENU; if (ud.multimode < 2) { @@ -7997,7 +8003,7 @@ FAKE_F3: clearsoundlocks(); // setview(0,0,xdim-1,ydim-1); - g_player[myconnectindex].ps.gm |= MODE_MENU; + g_player[myconnectindex].ps->gm |= MODE_MENU; if (ud.multimode < 2 && ud.recstat != 2) { ready2send = 0; @@ -8013,7 +8019,7 @@ FAKE_F3: FX_StopAllSounds(); clearsoundlocks(); - g_player[myconnectindex].ps.gm |= MODE_MENU; + g_player[myconnectindex].ps->gm |= MODE_MENU; if (ud.multimode < 2 && ud.recstat != 2) { ready2send = 0; @@ -8023,7 +8029,7 @@ FAKE_F3: } - if (KB_KeyPressed(sc_F6) && (g_player[myconnectindex].ps.gm&MODE_GAME)) + if (KB_KeyPressed(sc_F6) && (g_player[myconnectindex].ps->gm&MODE_GAME)) { KB_ClearKeyDown(sc_F6); @@ -8034,9 +8040,9 @@ FAKE_F3: KB_FlushKeyboardQueue(); - if (sprite[g_player[myconnectindex].ps.i].extra <= 0) + if (sprite[g_player[myconnectindex].ps->i].extra <= 0) { - FTA(118,&g_player[myconnectindex].ps); + FTA(118,g_player[myconnectindex].ps); return; } screencapt = 1; @@ -8057,15 +8063,15 @@ FAKE_F3: if (KB_KeyPressed(sc_F7)) { KB_ClearKeyDown(sc_F7); - if (g_player[myconnectindex].ps.over_shoulder_on) - g_player[myconnectindex].ps.over_shoulder_on = 0; + if (g_player[myconnectindex].ps->over_shoulder_on) + g_player[myconnectindex].ps->over_shoulder_on = 0; else { - g_player[myconnectindex].ps.over_shoulder_on = 1; + g_player[myconnectindex].ps->over_shoulder_on = 1; cameradist = 0; cameraclock = totalclock; } - FTA(109+g_player[myconnectindex].ps.over_shoulder_on,&g_player[myconnectindex].ps); + FTA(109+g_player[myconnectindex].ps->over_shoulder_on,g_player[myconnectindex].ps); } if (KB_KeyPressed(sc_F5) && ud.config.MusicDevice >= 0) @@ -8075,23 +8081,23 @@ FAKE_F3: Bstrcpy(fta_quotes[26],&map[(unsigned char)music_select].musicfn[0]); else fta_quotes[26][0] = '\0'; Bstrcat(fta_quotes[26],". USE SHIFT-F5 TO CHANGE."); - FTA(26,&g_player[myconnectindex].ps); + FTA(26,g_player[myconnectindex].ps); } if (KB_KeyPressed(sc_F8)) { KB_ClearKeyDown(sc_F8); ud.fta_on = !ud.fta_on; - if (ud.fta_on) FTA(23,&g_player[myconnectindex].ps); + if (ud.fta_on) FTA(23,g_player[myconnectindex].ps); else { ud.fta_on = 1; - FTA(24,&g_player[myconnectindex].ps); + FTA(24,g_player[myconnectindex].ps); ud.fta_on = 0; } } - if (KB_KeyPressed(sc_F9) && (g_player[myconnectindex].ps.gm&MODE_GAME)) + if (KB_KeyPressed(sc_F9) && (g_player[myconnectindex].ps->gm&MODE_GAME)) { KB_ClearKeyDown(sc_F9); @@ -8109,13 +8115,13 @@ FAKE_F3: if (ud.multimode > 1) { loadplayer(-1-lastsavedpos); - g_player[myconnectindex].ps.gm = MODE_GAME; + g_player[myconnectindex].ps->gm = MODE_GAME; } else { i = loadplayer(lastsavedpos); if (i == 0) - g_player[myconnectindex].ps.gm = MODE_GAME; + g_player[myconnectindex].ps->gm = MODE_GAME; } } } @@ -8126,7 +8132,7 @@ FAKE_F3: cmenu(500); FX_StopAllSounds(); clearsoundlocks(); - g_player[myconnectindex].ps.gm |= MODE_MENU; + g_player[myconnectindex].ps->gm |= MODE_MENU; if (ud.multimode < 2 && ud.recstat != 2) { ready2send = 0; @@ -8140,19 +8146,19 @@ FAKE_F3: j = totalclock-nonsharedtimer; nonsharedtimer += j; if (BUTTON(gamefunc_Enlarge_Screen)) - g_player[myconnectindex].ps.zoom += mulscale6(j,max(g_player[myconnectindex].ps.zoom,256)); + g_player[myconnectindex].ps->zoom += mulscale6(j,max(g_player[myconnectindex].ps->zoom,256)); if (BUTTON(gamefunc_Shrink_Screen)) - g_player[myconnectindex].ps.zoom -= mulscale6(j,max(g_player[myconnectindex].ps.zoom,256)); + g_player[myconnectindex].ps->zoom -= mulscale6(j,max(g_player[myconnectindex].ps->zoom,256)); - if ((g_player[myconnectindex].ps.zoom > 2048)) - g_player[myconnectindex].ps.zoom = 2048; - if ((g_player[myconnectindex].ps.zoom < 48)) - g_player[myconnectindex].ps.zoom = 48; + if ((g_player[myconnectindex].ps->zoom > 2048)) + g_player[myconnectindex].ps->zoom = 2048; + if ((g_player[myconnectindex].ps->zoom < 48)) + g_player[myconnectindex].ps->zoom = 48; } } - if (KB_KeyPressed(sc_Escape) && ud.overhead_on && g_player[myconnectindex].ps.newowner == -1) + if (KB_KeyPressed(sc_Escape) && ud.overhead_on && g_player[myconnectindex].ps->newowner == -1) { KB_ClearKeyDown(sc_Escape); ud.last_overhead = ud.overhead_on; @@ -8166,7 +8172,7 @@ FAKE_F3: CONTROL_ClearButton(gamefunc_AutoRun); ud.auto_run = 1-ud.auto_run; ud.config.RunMode = ud.auto_run; - FTA(85+ud.auto_run,&g_player[myconnectindex].ps); + FTA(85+ud.auto_run,g_player[myconnectindex].ps); } if (BUTTON(gamefunc_Map)) @@ -8198,9 +8204,9 @@ FAKE_F3: else if (ud.brightness < 0) ud.brightness = (7<<3); - setbrightness(ud.brightness>>2,&g_player[myconnectindex].ps.palette[0],0); - if (ud.brightness < 40) FTA(29 + (ud.brightness>>3) ,&g_player[myconnectindex].ps); - else if (ud.brightness < 80) FTA(96 + (ud.brightness>>3) - 5,&g_player[myconnectindex].ps); + setbrightness(ud.brightness>>2,&g_player[myconnectindex].ps->palette[0],0); + if (ud.brightness < 40) FTA(29 + (ud.brightness>>3) ,g_player[myconnectindex].ps); + else if (ud.brightness < 80) FTA(96 + (ud.brightness>>3) - 5,g_player[myconnectindex].ps); } } @@ -8770,7 +8776,7 @@ static void checkcommandline(int argc,const char **argv) } if (!Bstrcasecmp(c+1,"condebug")) { - condebug = 1; + g_ScriptDebug = 1; i++; continue; } @@ -9053,9 +9059,9 @@ static void checkcommandline(int argc,const char **argv) case 'z': case 'Z': c++; - condebug = atol(c); - if (!condebug) - condebug = 1; + g_ScriptDebug = atol(c); + if (!g_ScriptDebug) + g_ScriptDebug = 1; break; } } @@ -9114,11 +9120,11 @@ static void Logo(void) if (!NAM) { fadepal(0,0,0, 0,64,7); - //g_player[myconnectindex].ps.palette = drealms; + //g_player[myconnectindex].ps->palette = drealms; //palto(0,0,0,63); if (logoflags & LOGO_FLAG_3DRSCREEN) { - setgamepalette(&g_player[myconnectindex].ps, drealms, 11); // JBF 20040308 + setgamepalette(g_player[myconnectindex].ps, drealms, 11); // JBF 20040308 rotatesprite(0,0,65536L,0,DREALMS,0,0,2+8+16+64, 0,0,xdim-1,ydim-1); nextpage(); fadepal(0,0,0, 63,0,-7); @@ -9129,7 +9135,7 @@ static void Logo(void) getpackets(); if (restorepalette) { - setgamepalette(&g_player[myconnectindex].ps,g_player[myconnectindex].ps.palette,0); + setgamepalette(g_player[myconnectindex].ps,g_player[myconnectindex].ps->palette,0); restorepalette = 0; } } @@ -9143,8 +9149,8 @@ static void Logo(void) nextpage(); if (logoflags & LOGO_FLAG_TITLESCREEN) { - //g_player[myconnectindex].ps.palette = titlepal; - setgamepalette(&g_player[myconnectindex].ps, titlepal, 11); // JBF 20040308 + //g_player[myconnectindex].ps->palette = titlepal; + setgamepalette(g_player[myconnectindex].ps, titlepal, 11); // JBF 20040308 flushperms(); rotatesprite(0,0,65536L,0,BETASCREEN,0,0,2+8+16+64,0,0,xdim-1,ydim-1); KB_FlushKeyboardQueue(); @@ -9213,7 +9219,7 @@ static void Logo(void) getpackets(); if (restorepalette) { - setgamepalette(&g_player[myconnectindex].ps,g_player[myconnectindex].ps.palette,0); + setgamepalette(g_player[myconnectindex].ps,g_player[myconnectindex].ps->palette,0); restorepalette = 0; } nextpage(); @@ -9225,7 +9231,7 @@ static void Logo(void) if (ud.multimode > 1) { - setgamepalette(&g_player[myconnectindex].ps, titlepal, 11); + setgamepalette(g_player[myconnectindex].ps, titlepal, 11); rotatesprite(0,0,65536L,0,BETASCREEN,0,0,2+8+16+64,0,0,xdim-1,ydim-1); rotatesprite(160<<16,(104)<<16,60<<10,0,DUKENUKEM,0,0,2+8,0,0,xdim-1,ydim-1); @@ -9243,8 +9249,8 @@ static void Logo(void) clearview(0L); nextpage(); - //g_player[myconnectindex].ps.palette = palette; - setgamepalette(&g_player[myconnectindex].ps, palette, 0); // JBF 20040308 + //g_player[myconnectindex].ps->palette = palette; + setgamepalette(g_player[myconnectindex].ps, palette, 0); // JBF 20040308 sound(NITEVISION_ONOFF); //palto(0,0,0,0); @@ -9296,6 +9302,14 @@ static void freeconmem(void) Bfree(aGameVars[i].plValues); } + for (i=MAXPLAYERS-1;i>=0;i--) + { + if (g_player[i].ps != NULL) + Bfree(g_player[i].ps); + if (g_player[i].sync != NULL) + Bfree(g_player[i].sync); + } + if (label != NULL) Bfree(label); if (labelcode != NULL) @@ -9412,11 +9426,11 @@ static void genspriteremaps(void) fp = kopen4load(lookfn,0); if (fp != -1) - kread(fp,(char *)&numl,1); + kread(fp,(char *)&g_NumPalettes,1); else gameexit("\nERROR: File 'LOOKUP.DAT' not found."); - for (j=0;j < numl;j++) + for (j=0;j < g_NumPalettes;j++) { kread(fp,(signed char *)&look_pos,1); kread(fp,tempbuf,256); @@ -9425,11 +9439,11 @@ static void genspriteremaps(void) for (j = 0; j < 256; j++) tempbuf[j] = j; - numl++; - makepalookup(numl, tempbuf, 15, 15, 15, 1); - makepalookup(numl + 1, tempbuf, 15, 0, 0, 1); - makepalookup(numl + 2, tempbuf, 0, 15, 0, 1); - makepalookup(numl + 3, tempbuf, 0, 0, 15, 1); + g_NumPalettes++; + makepalookup(g_NumPalettes, tempbuf, 15, 15, 15, 1); + makepalookup(g_NumPalettes + 1, tempbuf, 15, 0, 0, 1); + makepalookup(g_NumPalettes + 2, tempbuf, 0, 15, 0, 1); + makepalookup(g_NumPalettes + 3, tempbuf, 0, 0, 15, 1); kread(fp,&waterpal[0],768); kread(fp,&slimepal[0],768); @@ -9594,7 +9608,6 @@ static void Startup(long argc, const char **argv) initprintf("Multiplayer initialized.\n"); screenpeek = myconnectindex; - g_player[myconnectindex].ps.palette = (char *) &palette[0]; if (networkmode == 255) networkmode = 1; @@ -9640,10 +9653,10 @@ static void sendplayerupdate(void) for (i=0;myname[i];i++) buf[l++] = Btoupper(myname[i]); buf[l++] = 0; - buf[l++] = g_player[myconnectindex].ps.aim_mode = ud.mouseaiming; - buf[l++] = g_player[myconnectindex].ps.auto_aim = ud.config.AutoAim; - buf[l++] = g_player[myconnectindex].ps.weaponswitch = ud.weaponswitch; - buf[l++] = g_player[myconnectindex].ps.palookup = g_player[myconnectindex].pcolor = ud.color; + buf[l++] = g_player[myconnectindex].ps->aim_mode = ud.mouseaiming; + buf[l++] = g_player[myconnectindex].ps->auto_aim = ud.config.AutoAim; + buf[l++] = g_player[myconnectindex].ps->weaponswitch = ud.weaponswitch; + buf[l++] = g_player[myconnectindex].ps->palookup = g_player[myconnectindex].pcolor = ud.color; buf[l++] = g_player[myconnectindex].pteam = ud.team; @@ -9735,22 +9748,22 @@ void updateplayer(void) if (numplayers > 1) { sendplayerupdate(); - if (sprite[g_player[myconnectindex].ps.i].picnum == APLAYER && sprite[g_player[myconnectindex].ps.i].pal != 1) - sprite[g_player[myconnectindex].ps.i].pal = g_player[myconnectindex].pcolor; + if (sprite[g_player[myconnectindex].ps->i].picnum == APLAYER && sprite[g_player[myconnectindex].ps->i].pal != 1) + sprite[g_player[myconnectindex].ps->i].pal = g_player[myconnectindex].pcolor; } else { int j; - g_player[myconnectindex].ps.aim_mode = ud.mouseaiming; - g_player[myconnectindex].ps.auto_aim = ud.config.AutoAim; - g_player[myconnectindex].ps.weaponswitch = ud.weaponswitch; - g_player[myconnectindex].ps.palookup = g_player[myconnectindex].pcolor = ud.color; - j = g_player[myconnectindex].ps.team; + g_player[myconnectindex].ps->aim_mode = ud.mouseaiming; + g_player[myconnectindex].ps->auto_aim = ud.config.AutoAim; + g_player[myconnectindex].ps->weaponswitch = ud.weaponswitch; + g_player[myconnectindex].ps->palookup = g_player[myconnectindex].pcolor = ud.color; + j = g_player[myconnectindex].ps->team; g_player[myconnectindex].pteam = ud.team; - if (sprite[g_player[myconnectindex].ps.i].picnum == APLAYER && sprite[g_player[myconnectindex].ps.i].pal != 1) - sprite[g_player[myconnectindex].ps.i].pal = g_player[myconnectindex].pcolor; + if (sprite[g_player[myconnectindex].ps->i].picnum == APLAYER && sprite[g_player[myconnectindex].ps->i].pal != 1) + sprite[g_player[myconnectindex].ps->i].pal = g_player[myconnectindex].pcolor; } } @@ -9796,7 +9809,7 @@ void backtomenu(void) boardfilename[0] = 0; if (ud.recstat == 1) closedemowrite(); ud.warp_on = 0; - g_player[myconnectindex].ps.gm = MODE_MENU; + g_player[myconnectindex].ps->gm = MODE_MENU; cmenu(0); KB_FlushKeyboardQueue(); if (VOLUMEALL) wm_setapptitle(HEAD2); @@ -9861,6 +9874,9 @@ void app_main(int argc,const char **argv) checkcommandline(argc,argv); + g_player[0].ps = (player_struct *) Bcalloc(1, sizeof(player_struct)); + g_player[0].sync = (input *) Bcalloc(1, sizeof(input)); + if (getcwd(cwd,BMAX_PATH)) addsearchpath(cwd); if (CommandPaths) @@ -10115,8 +10131,8 @@ void app_main(int argc,const char **argv) initprintf("\n"); - if (condebug) - initprintf("CON debugging activated (%d).\n\n",condebug); + if (g_ScriptDebug) + initprintf("CON debugging activated (level %d).\n\n",g_ScriptDebug); RegisterShutdownFunction(Shutdown); @@ -10128,13 +10144,24 @@ void app_main(int argc,const char **argv) Startup(argc,argv); // a bunch of stuff including compiling cons + if (numplayers > 1) + ud.multimode = numplayers; + + for (i=1;ipalette = (char *) &palette[0]; + i = 1; for (j=numplayers;jteam = g_player[j].pteam = i; + g_player[j].ps->weaponswitch = 3; + g_player[j].ps->auto_aim = 0; i = 1-i; } @@ -10145,7 +10172,6 @@ void app_main(int argc,const char **argv) if (numplayers > 1) { - ud.multimode = numplayers; sendlogon(); } else if (boardfilename[0] != 0) @@ -10237,7 +10263,7 @@ void app_main(int argc,const char **argv) gameexit(" The full version of Duke Nukem 3D supports 5 or more players."); } - setbrightness(ud.brightness>>2,&g_player[myconnectindex].ps.palette[0],0); + setbrightness(ud.brightness>>2,&g_player[myconnectindex].ps->palette[0],0); // ESCESCAPE; @@ -10249,9 +10275,9 @@ void app_main(int argc,const char **argv) if (ud.warp_on > 1 && ud.multimode < 2) { clearview(0L); - //g_player[myconnectindex].ps.palette = palette; + //g_player[myconnectindex].ps->palette = palette; //palto(0,0,0,0); - setgamepalette(&g_player[myconnectindex].ps, palette, 0); // JBF 20040308 + setgamepalette(g_player[myconnectindex].ps, palette, 0); // JBF 20040308 rotatesprite(320<<15,200<<15,65536L,0,LOADSCREEN,0,0,2+8+64,0,0,xdim-1,ydim-1); menutext(160,105,0,0,"LOADING SAVED GAME..."); nextpage(); @@ -10307,23 +10333,23 @@ MAIN_LOOP_RESTART: ud.auto_run = ud.config.RunMode; ud.showweapons = ud.config.ShowOpponentWeapons; - g_player[myconnectindex].ps.aim_mode = ud.mouseaiming; - g_player[myconnectindex].ps.auto_aim = ud.config.AutoAim; - g_player[myconnectindex].ps.weaponswitch = ud.weaponswitch; + g_player[myconnectindex].ps->aim_mode = ud.mouseaiming; + g_player[myconnectindex].ps->auto_aim = ud.config.AutoAim; + g_player[myconnectindex].ps->weaponswitch = ud.weaponswitch; g_player[myconnectindex].pteam = ud.team; if (gametype_flags[ud.coop] & GAMETYPE_FLAG_TDM) - g_player[myconnectindex].ps.palookup = g_player[myconnectindex].pcolor = getteampal(g_player[myconnectindex].pteam); + g_player[myconnectindex].ps->palookup = g_player[myconnectindex].pcolor = getteampal(g_player[myconnectindex].pteam); else { - if (ud.color) g_player[myconnectindex].ps.palookup = g_player[myconnectindex].pcolor = ud.color; - else g_player[myconnectindex].ps.palookup = g_player[myconnectindex].pcolor; + if (ud.color) g_player[myconnectindex].ps->palookup = g_player[myconnectindex].pcolor = ud.color; + else g_player[myconnectindex].ps->palookup = g_player[myconnectindex].pcolor; } ud.warp_on = 0; KB_KeyDown[sc_Pause] = 0; // JBF: I hate the pause key - while (!(g_player[myconnectindex].ps.gm&MODE_END)) //The whole loop!!!!!!!!!!!!!!!!!! + while (!(g_player[myconnectindex].ps->gm&MODE_END)) //The whole loop!!!!!!!!!!!!!!!!!! { if (handleevents()) { @@ -10339,13 +10365,13 @@ MAIN_LOOP_RESTART: OSD_DispatchQueued(); - if (ud.recstat == 2 || ud.multimode > 1 || (ud.show_help == 0 && (g_player[myconnectindex].ps.gm&MODE_MENU) != MODE_MENU)) - if (g_player[myconnectindex].ps.gm&MODE_GAME) + if (ud.recstat == 2 || ud.multimode > 1 || (ud.show_help == 0 && (g_player[myconnectindex].ps->gm&MODE_MENU) != MODE_MENU)) + if (g_player[myconnectindex].ps->gm&MODE_GAME) if (moveloop()) continue; - if (g_player[myconnectindex].ps.gm&MODE_EOL || g_player[myconnectindex].ps.gm&MODE_RESTART) + if (g_player[myconnectindex].ps->gm&MODE_EOL || g_player[myconnectindex].ps->gm&MODE_RESTART) { - if (g_player[myconnectindex].ps.gm&MODE_EOL) + if (g_player[myconnectindex].ps->gm&MODE_EOL) { closedemowrite(); @@ -10368,7 +10394,7 @@ MAIN_LOOP_RESTART: { doorders(); } - g_player[myconnectindex].ps.gm = MODE_MENU; + g_player[myconnectindex].ps->gm = MODE_MENU; cmenu(0); probey = 0; goto MAIN_LOOP_RESTART; @@ -10382,8 +10408,8 @@ MAIN_LOOP_RESTART: } display_bonus_screen = 1; ready2send = 0; - if (numplayers > 1) g_player[myconnectindex].ps.gm = MODE_GAME; - if (enterlevel(g_player[myconnectindex].ps.gm)) + if (numplayers > 1) g_player[myconnectindex].ps->gm = MODE_GAME; + if (enterlevel(g_player[myconnectindex].ps->gm)) { backtomenu(); goto MAIN_LOOP_RESTART; @@ -10394,7 +10420,7 @@ MAIN_LOOP_RESTART: cheats(); nonsharedkeys(); - if ((ud.show_help == 0 && ud.multimode < 2 && !(g_player[myconnectindex].ps.gm&MODE_MENU)) || ud.multimode > 1 || ud.recstat == 2) + if ((ud.show_help == 0 && ud.multimode < 2 && !(g_player[myconnectindex].ps->gm&MODE_MENU)) || ud.multimode > 1 || ud.recstat == 2) i = min(max((totalclock-ototalclock)*(65536L/TICSPERFRAME),0),65536); else i = 65536; @@ -10408,9 +10434,9 @@ MAIN_LOOP_RESTART: displayrooms(screenpeek,i); displayrest(i); - if (gotvote[myconnectindex] == 0 && voting != -1 && voting != myconnectindex) + if (g_player[myconnectindex].gotvote == 0 && voting != -1 && voting != myconnectindex) { - Bsprintf(tempbuf,"%s^00 HAS CALLED A VOTE FOR MAP",g_player[voting].user_name); + Bsprintf(tempbuf,"%s^00 HAS CALLED A VOTE FOR MAP",g_player[voting].user_name); gametext(160,40,tempbuf,0,2+8+16); Bsprintf(tempbuf,"%s (E%dL%d)",map[vote_episode*MAXLEVELS + vote_map].name,vote_episode+1,vote_map+1); gametext(160,48,tempbuf,0,2+8+16); @@ -10423,7 +10449,7 @@ MAIN_LOOP_RESTART: // addplayer(); // } - if (g_player[myconnectindex].ps.gm&MODE_DEMO) + if (g_player[myconnectindex].ps->gm&MODE_DEMO) goto MAIN_LOOP_RESTART; if (debug_on) caches(); @@ -10432,13 +10458,13 @@ MAIN_LOOP_RESTART: if (VOLUMEONE) { - if (ud.show_help == 0 && show_shareware > 0 && (g_player[myconnectindex].ps.gm&MODE_MENU) == 0) + if (ud.show_help == 0 && show_shareware > 0 && (g_player[myconnectindex].ps->gm&MODE_MENU) == 0) rotatesprite((320-50)<<16,9<<16,65536L,0,BETAVERSION,0,0,2+8+16+128,0,0,xdim-1,ydim-1); } nextpage(); - while (!(g_player[myconnectindex].ps.gm&MODE_MENU) && ready2send && totalclock >= ototalclock+TICSPERFRAME) + while (!(g_player[myconnectindex].ps->gm&MODE_MENU) && ready2send && totalclock >= ototalclock+TICSPERFRAME) faketimerhandler(); } @@ -10526,15 +10552,15 @@ static int opendemoread(int which_demo) // 0 = mine for (i=0;iaim_mode,sizeof(int32)) != sizeof(int32)) goto corrupt; + if (kread(recfilep,(int32 *)&g_player[i].ps->auto_aim,sizeof(int32)) != sizeof(int32)) goto corrupt; // JBF 20031126 + if (kread(recfilep,(int32 *)&g_player[i].ps->weaponswitch,sizeof(int32)) != sizeof(int32)) goto corrupt; if (kread(recfilep,(int32 *)&g_player[i].pcolor,sizeof(int32)) != sizeof(int32)) goto corrupt; - g_player[i].ps.palookup = g_player[i].pcolor; + g_player[i].ps->palookup = g_player[i].pcolor; if (kread(recfilep,(int32 *)&g_player[i].pteam,sizeof(int32)) != sizeof(int32)) goto corrupt; - g_player[i].ps.team = g_player[i].pteam; + g_player[i].ps->team = g_player[i].pteam; } ud.god = ud.cashman = ud.eog = ud.showallmap = 0; @@ -10580,10 +10606,10 @@ void opendemowrite(void) for (i=0;iaim_mode,sizeof(int32),1,frecfilep); + fwrite((int32 *)&g_player[i].ps->auto_aim,sizeof(int32),1,frecfilep); // JBF 20031126 + fwrite(&g_player[i].ps->weaponswitch,sizeof(int32),1,frecfilep); fwrite(&g_player[i].pcolor,sizeof(int32),1,frecfilep); fwrite(&g_player[i].pteam,sizeof(int32),1,frecfilep); } @@ -10598,7 +10624,7 @@ static void record(void) for (i=connecthead;i>=0;i=connectpoint2[i]) { - copybufbyte(&g_player[i].sync,&recsync[ud.reccnt],sizeof(input)); + copybufbyte(g_player[i].sync,&recsync[ud.reccnt],sizeof(input)); ud.reccnt++; totalreccnt++; if (ud.reccnt >= RECSYNCBUFSIZ) @@ -10638,7 +10664,7 @@ static long playback(void) RECHECK: - in_menu = g_player[myconnectindex].ps.gm&MODE_MENU; + in_menu = g_player[myconnectindex].ps->gm&MODE_MENU; pub = NUMPAGES; pus = NUMPAGES; @@ -10655,10 +10681,10 @@ RECHECK: goto RECHECK; } fadepal(0,0,0, 0,63,7); - setgamepalette(&g_player[myconnectindex].ps, palette, 1); // JBF 20040308 + setgamepalette(g_player[myconnectindex].ps, palette, 1); // JBF 20040308 drawbackground(); menus(); - //g_player[myconnectindex].ps.palette = palette; + //g_player[myconnectindex].ps->palette = palette; nextpage(); fadepal(0,0,0, 63,0,-7); ud.reccnt = 0; @@ -10675,7 +10701,7 @@ RECHECK: { FX_StopAllSounds(); clearsoundlocks(); - g_player[myconnectindex].ps.gm |= MODE_MENU; + g_player[myconnectindex].ps->gm |= MODE_MENU; } ready2send = 0; @@ -10700,14 +10726,14 @@ RECHECK: foundemo = 0; ud.reccnt = 0; kclose(recfilep); - g_player[myconnectindex].ps.gm |= MODE_MENU; + g_player[myconnectindex].ps->gm |= MODE_MENU; goto RECHECK; } } for (j=connecthead;j>=0;j=connectpoint2[j]) { - copybufbyte(&recsync[i],&inputfifo[g_player[j].movefifoend&(MOVEFIFOSIZ-1)][j],sizeof(input)); + copybufbyte(&recsync[i],&inputfifo[g_player[j].movefifoend&(MOVEFIFOSIZ-1)][j],sizeof(input)); g_player[j].movefifoend++; i++; ud.reccnt--; @@ -10725,31 +10751,31 @@ RECHECK: displayrooms(screenpeek,j); displayrest(j); - if (ud.multimode > 1 && g_player[myconnectindex].ps.gm) + if (ud.multimode > 1 && g_player[myconnectindex].ps->gm) getpackets(); - if (gotvote[myconnectindex] == 0 && voting != -1 && voting != myconnectindex) + if (g_player[myconnectindex].gotvote == 0 && voting != -1 && voting != myconnectindex) gametext(160,60,"PRESS F1 TO VOTE YES, F2 TO VOTE NO",0,2+8+16); } - if ((g_player[myconnectindex].ps.gm&MODE_MENU) && (g_player[myconnectindex].ps.gm&MODE_EOL)) + if ((g_player[myconnectindex].ps->gm&MODE_MENU) && (g_player[myconnectindex].ps->gm&MODE_EOL)) goto RECHECK; - if (KB_KeyPressed(sc_Escape) && (g_player[myconnectindex].ps.gm&MODE_MENU) == 0 && (g_player[myconnectindex].ps.gm&MODE_TYPE) == 0) + if (KB_KeyPressed(sc_Escape) && (g_player[myconnectindex].ps->gm&MODE_MENU) == 0 && (g_player[myconnectindex].ps->gm&MODE_TYPE) == 0) { KB_ClearKeyDown(sc_Escape); FX_StopAllSounds(); clearsoundlocks(); - g_player[myconnectindex].ps.gm |= MODE_MENU; + g_player[myconnectindex].ps->gm |= MODE_MENU; cmenu(0); intomenusounds(); } - if (g_player[myconnectindex].ps.gm&MODE_TYPE) + if (g_player[myconnectindex].ps->gm&MODE_TYPE) { typemode(); - if ((g_player[myconnectindex].ps.gm&MODE_TYPE) != MODE_TYPE) - g_player[myconnectindex].ps.gm = MODE_MENU; + if ((g_player[myconnectindex].ps->gm&MODE_TYPE) != MODE_TYPE) + g_player[myconnectindex].ps->gm = MODE_MENU; } else { @@ -10763,7 +10789,7 @@ RECHECK: { KB_FlushKeyboardQueue(); CONTROL_ClearButton(gamefunc_SendMessage); - g_player[myconnectindex].ps.gm = MODE_TYPE; + g_player[myconnectindex].ps->gm = MODE_TYPE; typebuf[0] = 0; inputloc = 0; } @@ -10780,14 +10806,14 @@ RECHECK: if (VOLUMEONE) { - if (ud.show_help == 0 && (g_player[myconnectindex].ps.gm&MODE_MENU) == 0) + if (ud.show_help == 0 && (g_player[myconnectindex].ps->gm&MODE_MENU) == 0) rotatesprite((320-50)<<16,9<<16,65536L,0,BETAVERSION,0,0,2+8+16+128,0,0,xdim-1,ydim-1); } handleevents(); getpackets(); nextpage(); - if (g_player[myconnectindex].ps.gm==MODE_END || g_player[myconnectindex].ps.gm==MODE_GAME) + if (g_player[myconnectindex].ps->gm==MODE_END || g_player[myconnectindex].ps->gm==MODE_GAME) { if (foundemo) kclose(recfilep); @@ -10810,7 +10836,7 @@ RECHECK: } #endif - if (g_player[myconnectindex].ps.gm&MODE_MENU) goto RECHECK; + if (g_player[myconnectindex].ps->gm&MODE_MENU) goto RECHECK; return 1; } @@ -10842,7 +10868,7 @@ static void fakedomovethingscorrect(void) if (numplayers < 2) return; i = ((movefifoplc-1)&(MOVEFIFOSIZ-1)); - p = &g_player[myconnectindex].ps; + p = g_player[myconnectindex].ps; if (p->posx == myxbak[i] && p->posy == myybak[i] && p->posz == myzbak[i] && p->horiz == myhorizbak[i] && p->ang == myangbak[i]) return; @@ -10885,7 +10911,7 @@ static void fakedomovethings(void) syn = (input *)&inputfifo[fakemovefifoplc&(MOVEFIFOSIZ-1)][myconnectindex]; - p = &g_player[myconnectindex].ps; + p = g_player[myconnectindex].ps; backcstat = sprite[p->i].cstat; sprite[p->i].cstat &= ~257; @@ -11300,7 +11326,7 @@ FAKEHORIZONLY: ENDFAKEPROCESSINPUT: - OnEvent(EVENT_FAKEDOMOVETHINGS, g_player[myconnectindex].ps.i, myconnectindex, -1); + OnEvent(EVENT_FAKEDOMOVETHINGS, g_player[myconnectindex].ps->i, myconnectindex, -1); myxbak[fakemovefifoplc&(MOVEFIFOSIZ-1)] = myx; myybak[fakemovefifoplc&(MOVEFIFOSIZ-1)] = myy; @@ -11318,11 +11344,11 @@ static int domovethings(void) char ch; for (i=connecthead;i>=0;i=connectpoint2[i]) - if (g_player[i].sync.bits&(1<<17)) + if (g_player[i].sync->bits&(1<<17)) { multiflag = 2; - multiwhat = (g_player[i].sync.bits>>18)&1; - multipos = (unsigned)(g_player[i].sync.bits>>19)&15; + multiwhat = (g_player[i].sync->bits>>18)&1; + multipos = (unsigned)(g_player[i].sync->bits>>19)&15; multiwho = i; if (multiwhat) @@ -11332,13 +11358,13 @@ static int domovethings(void) if (multiwho != myconnectindex) { - Bsprintf(fta_quotes[122],"%s^00 SAVED A MULTIPLAYER GAME",&g_player[multiwho].user_name[0]); - FTA(122,&g_player[myconnectindex].ps); + Bsprintf(fta_quotes[122],"%s^00 SAVED A MULTIPLAYER GAME",&g_player[multiwho].user_name[0]); + FTA(122,g_player[myconnectindex].ps); } else { Bstrcpy(fta_quotes[122],"MULTIPLAYER GAME SAVED"); - FTA(122,&g_player[myconnectindex].ps); + FTA(122,g_player[myconnectindex].ps); } break; } @@ -11355,12 +11381,12 @@ static int domovethings(void) if (multiwho != myconnectindex) { Bsprintf(fta_quotes[122],"%s^00 LOADED A MULTIPLAYER GAME",&g_player[multiwho].user_name[0]); - FTA(122,&g_player[myconnectindex].ps); + FTA(122,g_player[myconnectindex].ps); } else { Bstrcpy(fta_quotes[122],"MULTIPLAYER GAME LOADED"); - FTA(122,&g_player[myconnectindex].ps); + FTA(122,g_player[myconnectindex].ps); } return 1; } @@ -11385,30 +11411,30 @@ static int domovethings(void) long sx,sy,sz; short sect,hw,hs; - for (i=0;iholoduke_on != -1) + sprite[g_player[i].ps->holoduke_on].cstat ^= 256; - hitscan(g_player[screenpeek].ps.posx,g_player[screenpeek].ps.posy,g_player[screenpeek].ps.posz,g_player[screenpeek].ps.cursectnum, - sintable[(g_player[screenpeek].ps.ang+512)&2047], - sintable[g_player[screenpeek].ps.ang&2047], - (100-g_player[screenpeek].ps.horiz-g_player[screenpeek].ps.horizoff)<<11,§,&hw,&hs,&sx,&sy,&sz,0xffff0030); + hitscan(g_player[screenpeek].ps->posx,g_player[screenpeek].ps->posy,g_player[screenpeek].ps->posz,g_player[screenpeek].ps->cursectnum, + sintable[(g_player[screenpeek].ps->ang+512)&2047], + sintable[g_player[screenpeek].ps->ang&2047], + (100-g_player[screenpeek].ps->horiz-g_player[screenpeek].ps->horizoff)<<11,§,&hw,&hs,&sx,&sy,&sz,0xffff0030); - for (i=0;iholoduke_on != -1) + sprite[g_player[i].ps->holoduke_on].cstat ^= 256; - if (!(g_player[myconnectindex].ps.gm & MODE_MENU) && sprite[hs].picnum == APLAYER && sprite[hs].yvel != screenpeek && g_player[sprite[hs].yvel].ps.dead_flag == 0) + if (!(g_player[myconnectindex].ps->gm & MODE_MENU) && sprite[hs].picnum == APLAYER && sprite[hs].yvel != screenpeek && g_player[sprite[hs].yvel].ps->dead_flag == 0) { - if (g_player[screenpeek].ps.fta == 0 || g_player[screenpeek].ps.ftq == 117) + if (g_player[screenpeek].ps->fta == 0 || g_player[screenpeek].ps->ftq == 117) { - if (ldist(&sprite[g_player[screenpeek].ps.i],&sprite[hs]) < 9216) + if (ldist(&sprite[g_player[screenpeek].ps->i],&sprite[hs]) < 9216) { Bsprintf(fta_quotes[117],"%s",&g_player[sprite[hs].yvel].user_name[0]); - g_player[screenpeek].ps.fta = 12, g_player[screenpeek].ps.ftq = 117; + g_player[screenpeek].ps->fta = 12, g_player[screenpeek].ps->ftq = 117; } } - else if (g_player[screenpeek].ps.fta > 2) g_player[screenpeek].ps.fta -= 3; + else if (g_player[screenpeek].ps->fta > 2) g_player[screenpeek].ps->fta -= 3; } } @@ -11425,7 +11451,7 @@ static int domovethings(void) everyothertime++; for (i=connecthead;i>=0;i=connectpoint2[i]) - copybufbyte(&inputfifo[movefifoplc&(MOVEFIFOSIZ-1)][i],&g_player[i].sync,sizeof(input)); + copybufbyte(&inputfifo[movefifoplc&(MOVEFIFOSIZ-1)][i],g_player[i].sync,sizeof(input)); movefifoplc++; updateinterpolations(); @@ -11433,7 +11459,7 @@ static int domovethings(void) j = -1; for (i=connecthead;i>=0;i=connectpoint2[i]) { - if ((g_player[i].sync.bits&(1<<26)) == 0) + if ((g_player[i].sync->bits&(1<<26)) == 0) { j = i; continue; @@ -11461,8 +11487,8 @@ static int domovethings(void) pus = NUMPAGES; vscrn(); - quickkill(&g_player[i].ps); - deletesprite(g_player[i].ps.i); + quickkill(g_player[i].ps); + deletesprite(g_player[i].ps->i); Bsprintf(buf,"%s^00 is history!",g_player[i].user_name); adduserquote(buf); @@ -11470,12 +11496,15 @@ static int domovethings(void) if (voting == i) { - Bmemset(votes,0,sizeof(votes)); - Bmemset(gotvote,0,sizeof(gotvote)); + for (i=0;iftq = 116, g_player[myconnectindex].ps->fta = 180; if (j < 0 && networkmode == 0) gameexit("The server/master player just quit the game; disconnected."); @@ -11485,7 +11514,7 @@ static int domovethings(void) { ch = (char)(randomseed&255); for (i=connecthead;i>=0;i=connectpoint2[i]) - ch += ((g_player[i].ps.posx+g_player[i].ps.posy+g_player[i].ps.posz+g_player[i].ps.ang+g_player[i].ps.horiz)&255); + ch += ((g_player[i].ps->posx+g_player[i].ps->posy+g_player[i].ps->posz+g_player[i].ps->ang+g_player[i].ps->horiz)&255); g_player[myconnectindex].syncval[g_player[myconnectindex].syncvalhead&(MOVEFIFOSIZ-1)] = ch; g_player[myconnectindex].syncvalhead++; } @@ -11500,20 +11529,20 @@ static int domovethings(void) for (i=connecthead;i>=0;i=connectpoint2[i]) { - if (g_player[i].sync.extbits&(1<<6)) + if (g_player[i].sync->extbits&(1<<6)) { - g_player[i].ps.team = g_player[i].pteam; + g_player[i].ps->team = g_player[i].pteam; if (gametype_flags[ud.coop] & GAMETYPE_FLAG_TDM) { - hittype[g_player[i].ps.i].picnum = APLAYERTOP; - quickkill(&g_player[i].ps); + hittype[g_player[i].ps->i].picnum = APLAYERTOP; + quickkill(g_player[i].ps); } } if (gametype_flags[ud.coop] & GAMETYPE_FLAG_TDM) - g_player[i].ps.palookup = g_player[i].pcolor = getteampal(g_player[i].ps.team); + g_player[i].ps->palookup = g_player[i].pcolor = getteampal(g_player[i].ps->team); - if (sprite[g_player[i].ps.i].pal != 1) - sprite[g_player[i].ps.i].pal = g_player[i].pcolor; + if (sprite[g_player[i].ps->i].pal != 1) + sprite[g_player[i].ps->i].pal = g_player[i].pcolor; sharedkeys(i); @@ -11549,8 +11578,8 @@ static void doorders(void) setview(0,0,xdim-1,ydim-1); fadepal(0,0,0, 0,63,7); - //g_player[myconnectindex].ps.palette = palette; - setgamepalette(&g_player[myconnectindex].ps, palette, 1); // JBF 20040308 + //g_player[myconnectindex].ps->palette = palette; + setgamepalette(g_player[myconnectindex].ps, palette, 1); // JBF 20040308 KB_FlushKeyboardQueue(); rotatesprite(0,0,65536L,0,ORDERING,0,0,2+8+16+64, 0,0,xdim-1,ydim-1); fadepal(0,0,0, 63,0,-7); @@ -11649,11 +11678,11 @@ void dobonus(int bonusonly) case 0: if (ud.lockout == 0) { - setgamepalette(&g_player[myconnectindex].ps, endingpal, 11); // JBF 20040308 + setgamepalette(g_player[myconnectindex].ps, endingpal, 11); // JBF 20040308 clearview(0L); rotatesprite(0,50<<16,65536L,0,VICTORY1,0,0,2+8+16+64+128,0,0,xdim-1,ydim-1); nextpage(); - //g_player[myconnectindex].ps.palette = endingpal; + //g_player[myconnectindex].ps->palette = endingpal; fadepal(0,0,0, 63,0,-1); KB_FlushKeyboardQueue(); @@ -11711,8 +11740,8 @@ void dobonus(int bonusonly) fadepal(0,0,0, 0,64,1); KB_FlushKeyboardQueue(); - //g_player[myconnectindex].ps.palette = palette; - setgamepalette(&g_player[myconnectindex].ps, palette, 11); // JBF 20040308 + //g_player[myconnectindex].ps->palette = palette; + setgamepalette(g_player[myconnectindex].ps, palette, 11); // JBF 20040308 rotatesprite(0,0,65536L,0,3292,0,0,2+8+16+64, 0,0,xdim-1,ydim-1); IFISSOFTMODE fadepal(0,0,0, 63,0,-1); @@ -11745,8 +11774,8 @@ void dobonus(int bonusonly) fadepal(0,0,0, 0,64,1); setview(0,0,xdim-1,ydim-1); KB_FlushKeyboardQueue(); - //g_player[myconnectindex].ps.palette = palette; - setgamepalette(&g_player[myconnectindex].ps, palette, 11); // JBF 20040308 + //g_player[myconnectindex].ps->palette = palette; + setgamepalette(g_player[myconnectindex].ps, palette, 11); // JBF 20040308 rotatesprite(0,0,65536L,0,3293,0,0,2+8+16+64, 0,0,xdim-1,ydim-1); IFISSOFTMODE fadepal(0,0,0, 63,0,-1); else nextpage(); @@ -11786,8 +11815,8 @@ void dobonus(int bonusonly) sound(ENDSEQVOL3SND4); KB_FlushKeyBoardQueue(); - //g_player[myconnectindex].ps.palette = palette; - setgamepalette(&g_player[myconnectindex].ps, palette, 11); // JBF 20040308 + //g_player[myconnectindex].ps->palette = palette; + setgamepalette(g_player[myconnectindex].ps, palette, 11); // JBF 20040308 IFISSOFTMODE palto(0,0,0,63); clearview(0L); menutext(160,60,0,0,"THANKS TO ALL OUR"); @@ -11916,8 +11945,8 @@ ENDANM: FRAGBONUS: - //g_player[myconnectindex].ps.palette = palette; - setgamepalette(&g_player[myconnectindex].ps, palette, 11); // JBF 20040308 + //g_player[myconnectindex].ps->palette = palette; + setgamepalette(g_player[myconnectindex].ps, palette, 11); // JBF 20040308 IFISSOFTMODE palto(0,0,0,63); // JBF 20031228 KB_FlushKeyboardQueue(); totalclock = 0; @@ -11956,15 +11985,15 @@ FRAGBONUS: Bsprintf(tempbuf,"%d",i+1); minitext(30,90+t,tempbuf,0,2+8+16+128); - minitext(38,90+t,g_player[i].user_name,g_player[i].ps.palookup,2+8+16+128); + minitext(38,90+t,g_player[i].user_name,g_player[i].ps->palookup,2+8+16+128); for (y=0;yfraggedself); minitext(92+(y*23),90+t,tempbuf,2,2+8+16+128); - xfragtotal -= g_player[y].ps.fraggedself; + xfragtotal -= g_player[y].ps->fraggedself; } else { @@ -11992,7 +12021,7 @@ FRAGBONUS: for (i=0;ifraggedself; yfragtotal += g_player[i].frags[y]; } Bsprintf(tempbuf,"%-4d",yfragtotal); @@ -12047,17 +12076,17 @@ FRAGBONUS: playerbest = CONFIG_GetMapBestTime(map[ud.volume_number*MAXLEVELS+ud.last_level-1].filename); - if (g_player[myconnectindex].ps.player_par < playerbest || playerbest < 0) + if (g_player[myconnectindex].ps->player_par < playerbest || playerbest < 0) { - CONFIG_SetMapBestTime(map[ud.volume_number*MAXLEVELS+ud.last_level-1].filename, g_player[myconnectindex].ps.player_par); + CONFIG_SetMapBestTime(map[ud.volume_number*MAXLEVELS+ud.last_level-1].filename, g_player[myconnectindex].ps->player_par); // if(playerbest != -1) - // playerbest = g_player[myconnectindex].ps.player_par; + // playerbest = g_player[myconnectindex].ps->player_par; } { int ii, ij; - for (ii=g_player[myconnectindex].ps.player_par/(26*60), ij=1; ii>9; ii/=10, ij++) ; + for (ii=g_player[myconnectindex].ps->player_par/(26*60), ij=1; ii>9; ii/=10, ij++) ; clockpad = max(clockpad,ij); if (!(ud.volume_number == 0 && ud.last_level-1 == 7)) { @@ -12080,7 +12109,7 @@ FRAGBONUS: handleevents(); AudioUpdate(); - if (g_player[myconnectindex].ps.gm&MODE_EOL) + if (g_player[myconnectindex].ps->gm&MODE_EOL) { rotatesprite(0,0,65536L,0,BONUSSCREEN+gfx_offset,0,0,2+8+16+64+128,0,0,xdim-1,ydim-1); @@ -12158,7 +12187,7 @@ FRAGBONUS: } if (playerbest > 0) { - gametext(10,yy+9,g_player[myconnectindex].ps.player_parplayer_parplayer_par/(26*60)), + (g_player[myconnectindex].ps->player_par/26)%60); gametext((320>>2)+71,yy+9,tempbuf,0,2+8+16); - if (g_player[myconnectindex].ps.player_par < playerbest) + if (g_player[myconnectindex].ps->player_par < playerbest) gametext((320>>2)+71+(clockpad*24),yy+9,"New record!",0,2+8+16); yy+=10; @@ -12234,7 +12263,7 @@ FRAGBONUS: bonuscnt++; sound(PIPEBOMB_EXPLODE); } - sprintf(tempbuf,"%-3ld",g_player[myconnectindex].ps.actors_killed); + sprintf(tempbuf,"%-3ld",g_player[myconnectindex].ps->actors_killed); gametext((320>>2)+70,yy+9,tempbuf,0,2+8+16); yy += 10; if (ud.player_skill > 3) @@ -12245,9 +12274,9 @@ FRAGBONUS: } else { - if ((g_player[myconnectindex].ps.max_actors_killed-g_player[myconnectindex].ps.actors_killed) < 0) + if ((g_player[myconnectindex].ps->max_actors_killed-g_player[myconnectindex].ps->actors_killed) < 0) sprintf(tempbuf,"%-3d",0); - else sprintf(tempbuf,"%-3ld",g_player[myconnectindex].ps.max_actors_killed-g_player[myconnectindex].ps.actors_killed); + else sprintf(tempbuf,"%-3ld",g_player[myconnectindex].ps->max_actors_killed-g_player[myconnectindex].ps->actors_killed); gametext((320>>2)+70,yy+9,tempbuf,0,2+8+16); yy += 10; } @@ -12271,12 +12300,12 @@ FRAGBONUS: bonuscnt++; sound(PIPEBOMB_EXPLODE); } - sprintf(tempbuf,"%-3ld",g_player[myconnectindex].ps.secret_rooms); + sprintf(tempbuf,"%-3ld",g_player[myconnectindex].ps->secret_rooms); gametext((320>>2)+70,yy+9,tempbuf,0,2+8+16); yy += 10; - if (g_player[myconnectindex].ps.secret_rooms > 0) - sprintf(tempbuf,"%-3ld%%",(100*g_player[myconnectindex].ps.secret_rooms/g_player[myconnectindex].ps.max_secret_rooms)); - sprintf(tempbuf,"%-3ld",g_player[myconnectindex].ps.max_secret_rooms-g_player[myconnectindex].ps.secret_rooms); + if (g_player[myconnectindex].ps->secret_rooms > 0) + sprintf(tempbuf,"%-3ld%%",(100*g_player[myconnectindex].ps->secret_rooms/g_player[myconnectindex].ps->max_secret_rooms)); + sprintf(tempbuf,"%-3ld",g_player[myconnectindex].ps->max_secret_rooms-g_player[myconnectindex].ps->secret_rooms); gametext((320>>2)+70,yy+9,tempbuf,0,2+8+16); yy += 10; } diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 804228edd..0f703f593 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -852,14 +852,14 @@ static void skipcomments(void) } else if (c == '/' && textptr[1] == '/') { - if (!(error || warning) && condebug > 1) + if (!(error || warning) && g_ScriptDebug > 1) initprintf("%s:%ld: debug: got comment.\n",compilefile,line_number); while (*textptr != 0x0a && *textptr != 0x0d && *textptr != 0) textptr++; } else if (c == '/' && textptr[1] == '*') { - if (!(error || warning) && condebug > 1) + if (!(error || warning) && g_ScriptDebug > 1) initprintf("%s:%ld: debug: got start of comment block.\n",compilefile,line_number); while (*textptr && !(textptr[0] == '*' && textptr[1] == '/')) { @@ -867,11 +867,11 @@ static void skipcomments(void) line_number++; textptr++; } - if ((!(error || warning) && condebug > 1) && (textptr[0] == '*' && textptr[1] == '/')) + if ((!(error || warning) && g_ScriptDebug > 1) && (textptr[0] == '*' && textptr[1] == '/')) initprintf("%s:%ld: debug: got end of comment block.\n",compilefile,line_number); if (!*textptr) { - if (!(error || warning) && condebug) + if (!(error || warning) && g_ScriptDebug) initprintf("%s:%ld: debug: EOF in comment!\n",compilefile,line_number); ReportError(-1); initprintf("%s:%ld: error: found `/*' with no `*/'.\n",compilefile,line_number); @@ -1152,7 +1152,7 @@ static void getlabel(void) label[(labelcnt<<6)+i++] = *(textptr++); label[(labelcnt<<6)+i] = 0; - if (!(error || warning) && condebug > 1) + if (!(error || warning) && g_ScriptDebug > 1) initprintf("%s:%ld: debug: got label `%s'.\n",compilefile,line_number,label+(labelcnt<<6)); } @@ -1220,7 +1220,7 @@ static long transword(void) //Returns its code # *scriptptr = i; textptr += l; scriptptr++; - if (!(error || warning) && condebug) + if (!(error || warning) && g_ScriptDebug) initprintf("%s:%ld: debug: translating keyword `%s'.\n",compilefile,line_number,keyw[i]); return i; } @@ -1250,7 +1250,7 @@ static void transvartype(int type) skipcomments(); if (!type && !labelsonly && (isdigit(*textptr) || ((*textptr == '-') && (isdigit(*(textptr+1)))))) { - if (!(error || warning) && condebug) + if (!(error || warning) && g_ScriptDebug) initprintf("%s:%ld: debug: accepted constant %ld in place of gamevar.\n",compilefile,line_number,atol(textptr)); *scriptptr++=MAXGAMEVARS; *scriptptr++=atol(textptr); @@ -1261,7 +1261,7 @@ static void transvartype(int type) { if (!type) { - if (!(error || warning) && condebug) + if (!(error || warning) && g_ScriptDebug) initprintf("%s:%ld: debug: flagging gamevar as negative.\n",compilefile,line_number,atol(textptr)); f = (MAXGAMEVARS<<1); } @@ -1292,7 +1292,7 @@ static void transvartype(int type) { if (Bstrcmp(tempbuf,label+(i<<6)) == 0 && (labeltype[i] & LABEL_DEFINE)) { - if (!(error || warning) && condebug) + if (!(error || warning) && g_ScriptDebug) initprintf("%s:%ld: debug: accepted defined label `%s' instead of gamevar.\n",compilefile,line_number,label+(i<<6)); *scriptptr++=MAXGAMEVARS; *scriptptr++=labelcode[i]; @@ -1327,7 +1327,7 @@ static void transvartype(int type) ReportError(-1); initprintf("%s:%ld: warning: found local gamevar `%s' used within %s; expect multiplayer synchronization issues.\n",compilefile,line_number,label+(labelcnt<<6),parsing_event?"a synced event":"an actor"); } - if (!(error || warning) && condebug > 1) + if (!(error || warning) && g_ScriptDebug > 1) initprintf("%s:%ld: debug: accepted gamevar `%s'.\n",compilefile,line_number,label+(labelcnt<<6)); i |= f; *scriptptr++=i; @@ -1389,7 +1389,7 @@ static long transnum(long type) if (labeltype[i] & type) { - if (!(error || warning) && condebug > 1) + if (!(error || warning) && g_ScriptDebug > 1) { gl = (char *)translatelabeltype(labeltype[i]); initprintf("%s:%ld: debug: accepted %s label `%s'.\n",compilefile,line_number,gl,label+(i<<6)); @@ -1424,7 +1424,7 @@ static long transnum(long type) ReportError(WARNING_LABELSONLY); // warning++; } - if (!(error || warning) && condebug > 1) + if (!(error || warning) && g_ScriptDebug > 1) initprintf("%s:%ld: debug: accepted constant %ld.\n",compilefile,line_number,atol(textptr)); *scriptptr = atol(textptr); scriptptr++; @@ -1484,7 +1484,7 @@ static int parsecommand(void) if ((error+warning) > 63 || (*textptr == '\0') || (*(textptr+1) == '\0')) return 1; - if (condebug) + if (g_ScriptDebug) ReportError(-1); if (checking_switch > 0) @@ -1532,7 +1532,7 @@ static int parsecommand(void) { if (labeltype[j] & LABEL_STATE) { - if (!(error || warning) && condebug > 1) + if (!(error || warning) && g_ScriptDebug > 1) initprintf("%s:%ld: debug: accepted state label `%s'.\n",compilefile,line_number,label+(j<<6)); *scriptptr = labelcode[j]; break; diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index aa581d306..55e632b56 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -932,10 +932,11 @@ static void DoPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) if (lVar1 != g_iThisActorID) iPlayer=GetGameVarID(lVar1, g_i, g_p); - if (iPlayer<0 || iPlayer >= MAXPLAYERS) + if (iPlayer<0 || iPlayer >= ud.multimode) { if (lVar2 == MAXGAMEVARS) insptr++; + OSD_Printf("DoPlayer(): invalid target player (%d) %d\n",iPlayer,g_i); return; } @@ -945,1011 +946,1011 @@ static void DoPlayer(int iSet, int lVar1, int lLabelID, int lVar2, int lParm2) { case PLAYER_ZOOM: if (iSet) - g_player[iPlayer].ps.zoom=lValue; + g_player[iPlayer].ps->zoom=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.zoom, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->zoom, g_i, g_p); break; case PLAYER_EXITX: if (iSet) - g_player[iPlayer].ps.exitx=lValue; + g_player[iPlayer].ps->exitx=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.exitx, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->exitx, g_i, g_p); break; case PLAYER_EXITY: if (iSet) - g_player[iPlayer].ps.exity=lValue; + g_player[iPlayer].ps->exity=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.exity, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->exity, g_i, g_p); break; case PLAYER_LOOGIEX: lTemp=lParm2; if (iSet) - g_player[iPlayer].ps.loogiex[lTemp]=lValue; + g_player[iPlayer].ps->loogiex[lTemp]=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.loogiex[lTemp], g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->loogiex[lTemp], g_i, g_p); break; case PLAYER_LOOGIEY: lTemp=lParm2; if (iSet) - g_player[iPlayer].ps.loogiey[lTemp]=lValue; + g_player[iPlayer].ps->loogiey[lTemp]=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.loogiey[lTemp], g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->loogiey[lTemp], g_i, g_p); break; case PLAYER_NUMLOOGS: if (iSet) - g_player[iPlayer].ps.numloogs=lValue; + g_player[iPlayer].ps->numloogs=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.numloogs, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->numloogs, g_i, g_p); break; case PLAYER_LOOGCNT: if (iSet) - g_player[iPlayer].ps.loogcnt=lValue; + g_player[iPlayer].ps->loogcnt=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.loogcnt, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->loogcnt, g_i, g_p); break; case PLAYER_POSX: if (iSet) - g_player[iPlayer].ps.posx=lValue; + g_player[iPlayer].ps->posx=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.posx, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->posx, g_i, g_p); break; case PLAYER_POSY: if (iSet) - g_player[iPlayer].ps.posy=lValue; + g_player[iPlayer].ps->posy=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.posy, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->posy, g_i, g_p); break; case PLAYER_POSZ: if (iSet) - g_player[iPlayer].ps.posz=lValue; + g_player[iPlayer].ps->posz=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.posz, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->posz, g_i, g_p); break; case PLAYER_HORIZ: if (iSet) - g_player[iPlayer].ps.horiz=lValue; + g_player[iPlayer].ps->horiz=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.horiz, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->horiz, g_i, g_p); break; case PLAYER_OHORIZ: if (iSet) - g_player[iPlayer].ps.ohoriz=lValue; + g_player[iPlayer].ps->ohoriz=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.ohoriz, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->ohoriz, g_i, g_p); break; case PLAYER_OHORIZOFF: if (iSet) - g_player[iPlayer].ps.ohorizoff=lValue; + g_player[iPlayer].ps->ohorizoff=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.ohorizoff, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->ohorizoff, g_i, g_p); break; case PLAYER_INVDISPTIME: if (iSet) - g_player[iPlayer].ps.invdisptime=lValue; + g_player[iPlayer].ps->invdisptime=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.invdisptime, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->invdisptime, g_i, g_p); break; case PLAYER_BOBPOSX: if (iSet) - g_player[iPlayer].ps.bobposx=lValue; + g_player[iPlayer].ps->bobposx=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.bobposx, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->bobposx, g_i, g_p); break; case PLAYER_BOBPOSY: if (iSet) - g_player[iPlayer].ps.bobposy=lValue; + g_player[iPlayer].ps->bobposy=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.bobposy, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->bobposy, g_i, g_p); break; case PLAYER_OPOSX: if (iSet) - g_player[iPlayer].ps.oposx=lValue; + g_player[iPlayer].ps->oposx=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.oposx, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->oposx, g_i, g_p); break; case PLAYER_OPOSY: if (iSet) - g_player[iPlayer].ps.oposy=lValue; + g_player[iPlayer].ps->oposy=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.oposy, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->oposy, g_i, g_p); break; case PLAYER_OPOSZ: if (iSet) - g_player[iPlayer].ps.oposz=lValue; + g_player[iPlayer].ps->oposz=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.oposz, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->oposz, g_i, g_p); break; case PLAYER_PYOFF: if (iSet) - g_player[iPlayer].ps.pyoff=lValue; + g_player[iPlayer].ps->pyoff=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.pyoff, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->pyoff, g_i, g_p); break; case PLAYER_OPYOFF: if (iSet) - g_player[iPlayer].ps.opyoff=lValue; + g_player[iPlayer].ps->opyoff=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.opyoff, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->opyoff, g_i, g_p); break; case PLAYER_POSXV: if (iSet) - g_player[iPlayer].ps.posxv=lValue; + g_player[iPlayer].ps->posxv=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.posxv, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->posxv, g_i, g_p); break; case PLAYER_POSYV: if (iSet) - g_player[iPlayer].ps.posyv=lValue; + g_player[iPlayer].ps->posyv=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.posyv, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->posyv, g_i, g_p); break; case PLAYER_POSZV: if (iSet) - g_player[iPlayer].ps.poszv=lValue; + g_player[iPlayer].ps->poszv=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.poszv, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->poszv, g_i, g_p); break; case PLAYER_LAST_PISSED_TIME: if (iSet) - g_player[iPlayer].ps.last_pissed_time=lValue; + g_player[iPlayer].ps->last_pissed_time=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.last_pissed_time, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->last_pissed_time, g_i, g_p); break; case PLAYER_TRUEFZ: if (iSet) - g_player[iPlayer].ps.truefz=lValue; + g_player[iPlayer].ps->truefz=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.truefz, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->truefz, g_i, g_p); break; case PLAYER_TRUECZ: if (iSet) - g_player[iPlayer].ps.truecz=lValue; + g_player[iPlayer].ps->truecz=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.truecz, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->truecz, g_i, g_p); break; case PLAYER_PLAYER_PAR: if (iSet) - g_player[iPlayer].ps.player_par=lValue; + g_player[iPlayer].ps->player_par=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.player_par, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->player_par, g_i, g_p); break; case PLAYER_VISIBILITY: if (iSet) - g_player[iPlayer].ps.visibility=lValue; + g_player[iPlayer].ps->visibility=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.visibility, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->visibility, g_i, g_p); break; case PLAYER_BOBCOUNTER: if (iSet) - g_player[iPlayer].ps.bobcounter=lValue; + g_player[iPlayer].ps->bobcounter=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.bobcounter, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->bobcounter, g_i, g_p); break; case PLAYER_WEAPON_SWAY: if (iSet) - g_player[iPlayer].ps.weapon_sway=lValue; + g_player[iPlayer].ps->weapon_sway=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.weapon_sway, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->weapon_sway, g_i, g_p); break; case PLAYER_PALS_TIME: if (iSet) - g_player[iPlayer].ps.pals_time=lValue; + g_player[iPlayer].ps->pals_time=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.pals_time, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->pals_time, g_i, g_p); break; case PLAYER_RANDOMFLAMEX: if (iSet) - g_player[iPlayer].ps.randomflamex=lValue; + g_player[iPlayer].ps->randomflamex=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.randomflamex, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->randomflamex, g_i, g_p); break; case PLAYER_CRACK_TIME: if (iSet) - g_player[iPlayer].ps.crack_time=lValue; + g_player[iPlayer].ps->crack_time=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.crack_time, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->crack_time, g_i, g_p); break; case PLAYER_AIM_MODE: if (iSet) - g_player[iPlayer].ps.aim_mode=lValue; + g_player[iPlayer].ps->aim_mode=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.aim_mode, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->aim_mode, g_i, g_p); break; case PLAYER_ANG: if (iSet) - g_player[iPlayer].ps.ang=lValue; + g_player[iPlayer].ps->ang=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.ang, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->ang, g_i, g_p); break; case PLAYER_OANG: if (iSet) - g_player[iPlayer].ps.oang=lValue; + g_player[iPlayer].ps->oang=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.oang, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->oang, g_i, g_p); break; case PLAYER_ANGVEL: if (iSet) - g_player[iPlayer].ps.angvel=lValue; + g_player[iPlayer].ps->angvel=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.angvel, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->angvel, g_i, g_p); break; case PLAYER_CURSECTNUM: if (iSet) - g_player[iPlayer].ps.cursectnum=lValue; + g_player[iPlayer].ps->cursectnum=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.cursectnum, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->cursectnum, g_i, g_p); break; case PLAYER_LOOK_ANG: if (iSet) - g_player[iPlayer].ps.look_ang=lValue; + g_player[iPlayer].ps->look_ang=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.look_ang, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->look_ang, g_i, g_p); break; case PLAYER_LAST_EXTRA: if (iSet) - g_player[iPlayer].ps.last_extra=lValue; + g_player[iPlayer].ps->last_extra=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.last_extra, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->last_extra, g_i, g_p); break; case PLAYER_SUBWEAPON: if (iSet) - g_player[iPlayer].ps.subweapon=lValue; + g_player[iPlayer].ps->subweapon=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.subweapon, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->subweapon, g_i, g_p); break; case PLAYER_AMMO_AMOUNT: lTemp=lParm2; if (iSet) - g_player[iPlayer].ps.ammo_amount[lTemp]=lValue; + g_player[iPlayer].ps->ammo_amount[lTemp]=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.ammo_amount[lTemp], g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->ammo_amount[lTemp], g_i, g_p); break; case PLAYER_WACKEDBYACTOR: if (iSet) - g_player[iPlayer].ps.wackedbyactor=lValue; + g_player[iPlayer].ps->wackedbyactor=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.wackedbyactor, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->wackedbyactor, g_i, g_p); break; case PLAYER_FRAG: if (iSet) - g_player[iPlayer].ps.frag=lValue; + g_player[iPlayer].ps->frag=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.frag, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->frag, g_i, g_p); break; case PLAYER_FRAGGEDSELF: if (iSet) - g_player[iPlayer].ps.fraggedself=lValue; + g_player[iPlayer].ps->fraggedself=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.fraggedself, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->fraggedself, g_i, g_p); break; case PLAYER_CURR_WEAPON: if (iSet) - g_player[iPlayer].ps.curr_weapon=lValue; + g_player[iPlayer].ps->curr_weapon=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.curr_weapon, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->curr_weapon, g_i, g_p); break; case PLAYER_LAST_WEAPON: if (iSet) - g_player[iPlayer].ps.last_weapon=lValue; + g_player[iPlayer].ps->last_weapon=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.last_weapon, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->last_weapon, g_i, g_p); break; case PLAYER_TIPINCS: if (iSet) - g_player[iPlayer].ps.tipincs=lValue; + g_player[iPlayer].ps->tipincs=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.tipincs, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->tipincs, g_i, g_p); break; case PLAYER_HORIZOFF: if (iSet) - g_player[iPlayer].ps.horizoff=lValue; + g_player[iPlayer].ps->horizoff=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.horizoff, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->horizoff, g_i, g_p); break; case PLAYER_WANTWEAPONFIRE: if (iSet) - g_player[iPlayer].ps.wantweaponfire=lValue; + g_player[iPlayer].ps->wantweaponfire=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.wantweaponfire, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->wantweaponfire, g_i, g_p); break; case PLAYER_HOLODUKE_AMOUNT: if (iSet) - g_player[iPlayer].ps.holoduke_amount=lValue; + g_player[iPlayer].ps->holoduke_amount=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.holoduke_amount, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->holoduke_amount, g_i, g_p); break; case PLAYER_NEWOWNER: if (iSet) - g_player[iPlayer].ps.newowner=lValue; + g_player[iPlayer].ps->newowner=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.newowner, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->newowner, g_i, g_p); break; case PLAYER_HURT_DELAY: if (iSet) - g_player[iPlayer].ps.hurt_delay=lValue; + g_player[iPlayer].ps->hurt_delay=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.hurt_delay, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->hurt_delay, g_i, g_p); break; case PLAYER_HBOMB_HOLD_DELAY: if (iSet) - g_player[iPlayer].ps.hbomb_hold_delay=lValue; + g_player[iPlayer].ps->hbomb_hold_delay=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.hbomb_hold_delay, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->hbomb_hold_delay, g_i, g_p); break; case PLAYER_JUMPING_COUNTER: if (iSet) - g_player[iPlayer].ps.jumping_counter=lValue; + g_player[iPlayer].ps->jumping_counter=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.jumping_counter, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->jumping_counter, g_i, g_p); break; case PLAYER_AIRLEFT: if (iSet) - g_player[iPlayer].ps.airleft=lValue; + g_player[iPlayer].ps->airleft=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.airleft, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->airleft, g_i, g_p); break; case PLAYER_KNEE_INCS: if (iSet) - g_player[iPlayer].ps.knee_incs=lValue; + g_player[iPlayer].ps->knee_incs=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.knee_incs, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->knee_incs, g_i, g_p); break; case PLAYER_ACCESS_INCS: if (iSet) - g_player[iPlayer].ps.access_incs=lValue; + g_player[iPlayer].ps->access_incs=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.access_incs, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->access_incs, g_i, g_p); break; case PLAYER_FTA: if (iSet) - g_player[iPlayer].ps.fta=lValue; + g_player[iPlayer].ps->fta=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.fta, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->fta, g_i, g_p); break; case PLAYER_FTQ: if (iSet) - g_player[iPlayer].ps.ftq=lValue; + g_player[iPlayer].ps->ftq=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.ftq, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->ftq, g_i, g_p); break; case PLAYER_ACCESS_WALLNUM: if (iSet) - g_player[iPlayer].ps.access_wallnum=lValue; + g_player[iPlayer].ps->access_wallnum=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.access_wallnum, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->access_wallnum, g_i, g_p); break; case PLAYER_ACCESS_SPRITENUM: if (iSet) - g_player[iPlayer].ps.access_spritenum=lValue; + g_player[iPlayer].ps->access_spritenum=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.access_spritenum, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->access_spritenum, g_i, g_p); break; case PLAYER_KICKBACK_PIC: if (iSet) - g_player[iPlayer].ps.kickback_pic=lValue; + g_player[iPlayer].ps->kickback_pic=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.kickback_pic, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->kickback_pic, g_i, g_p); break; case PLAYER_GOT_ACCESS: if (iSet) - g_player[iPlayer].ps.got_access=lValue; + g_player[iPlayer].ps->got_access=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.got_access, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->got_access, g_i, g_p); break; case PLAYER_WEAPON_ANG: if (iSet) - g_player[iPlayer].ps.weapon_ang=lValue; + g_player[iPlayer].ps->weapon_ang=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.weapon_ang, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->weapon_ang, g_i, g_p); break; case PLAYER_FIRSTAID_AMOUNT: if (iSet) - g_player[iPlayer].ps.firstaid_amount=lValue; + g_player[iPlayer].ps->firstaid_amount=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.firstaid_amount, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->firstaid_amount, g_i, g_p); break; case PLAYER_SOMETHINGONPLAYER: if (iSet) - g_player[iPlayer].ps.somethingonplayer=lValue; + g_player[iPlayer].ps->somethingonplayer=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.somethingonplayer, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->somethingonplayer, g_i, g_p); break; case PLAYER_ON_CRANE: if (iSet) - g_player[iPlayer].ps.on_crane=lValue; + g_player[iPlayer].ps->on_crane=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.on_crane, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->on_crane, g_i, g_p); break; case PLAYER_I: if (iSet) - g_player[iPlayer].ps.i=lValue; + g_player[iPlayer].ps->i=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.i, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->i, g_i, g_p); break; case PLAYER_ONE_PARALLAX_SECTNUM: if (iSet) - g_player[iPlayer].ps.one_parallax_sectnum=lValue; + g_player[iPlayer].ps->one_parallax_sectnum=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.one_parallax_sectnum, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->one_parallax_sectnum, g_i, g_p); break; case PLAYER_OVER_SHOULDER_ON: if (iSet) - g_player[iPlayer].ps.over_shoulder_on=lValue; + g_player[iPlayer].ps->over_shoulder_on=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.over_shoulder_on, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->over_shoulder_on, g_i, g_p); break; case PLAYER_RANDOM_CLUB_FRAME: if (iSet) - g_player[iPlayer].ps.random_club_frame=lValue; + g_player[iPlayer].ps->random_club_frame=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.random_club_frame, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->random_club_frame, g_i, g_p); break; case PLAYER_FIST_INCS: if (iSet) - g_player[iPlayer].ps.fist_incs=lValue; + g_player[iPlayer].ps->fist_incs=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.fist_incs, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->fist_incs, g_i, g_p); break; case PLAYER_ONE_EIGHTY_COUNT: if (iSet) - g_player[iPlayer].ps.one_eighty_count=lValue; + g_player[iPlayer].ps->one_eighty_count=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.one_eighty_count, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->one_eighty_count, g_i, g_p); break; case PLAYER_CHEAT_PHASE: if (iSet) - g_player[iPlayer].ps.cheat_phase=lValue; + g_player[iPlayer].ps->cheat_phase=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.cheat_phase, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->cheat_phase, g_i, g_p); break; case PLAYER_DUMMYPLAYERSPRITE: if (iSet) - g_player[iPlayer].ps.dummyplayersprite=lValue; + g_player[iPlayer].ps->dummyplayersprite=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.dummyplayersprite, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->dummyplayersprite, g_i, g_p); break; case PLAYER_EXTRA_EXTRA8: if (iSet) - g_player[iPlayer].ps.extra_extra8=lValue; + g_player[iPlayer].ps->extra_extra8=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.extra_extra8, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->extra_extra8, g_i, g_p); break; case PLAYER_QUICK_KICK: if (iSet) - g_player[iPlayer].ps.quick_kick=lValue; + g_player[iPlayer].ps->quick_kick=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.quick_kick, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->quick_kick, g_i, g_p); break; case PLAYER_HEAT_AMOUNT: if (iSet) - g_player[iPlayer].ps.heat_amount=lValue; + g_player[iPlayer].ps->heat_amount=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.heat_amount, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->heat_amount, g_i, g_p); break; case PLAYER_ACTORSQU: if (iSet) - g_player[iPlayer].ps.actorsqu=lValue; + g_player[iPlayer].ps->actorsqu=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.actorsqu, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->actorsqu, g_i, g_p); break; case PLAYER_TIMEBEFOREEXIT: if (iSet) - g_player[iPlayer].ps.timebeforeexit=lValue; + g_player[iPlayer].ps->timebeforeexit=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.timebeforeexit, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->timebeforeexit, g_i, g_p); break; case PLAYER_CUSTOMEXITSOUND: if (iSet) - g_player[iPlayer].ps.customexitsound=lValue; + g_player[iPlayer].ps->customexitsound=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.customexitsound, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->customexitsound, g_i, g_p); break; case PLAYER_WEAPRECS: if (iSet) - g_player[iPlayer].ps.weaprecs[16]=lValue; + g_player[iPlayer].ps->weaprecs[16]=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.weaprecs[16], g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->weaprecs[16], g_i, g_p); break; case PLAYER_WEAPRECCNT: if (iSet) - g_player[iPlayer].ps.weapreccnt=lValue; + g_player[iPlayer].ps->weapreccnt=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.weapreccnt, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->weapreccnt, g_i, g_p); break; case PLAYER_INTERFACE_TOGGLE_FLAG: if (iSet) - g_player[iPlayer].ps.interface_toggle_flag=lValue; + g_player[iPlayer].ps->interface_toggle_flag=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.interface_toggle_flag, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->interface_toggle_flag, g_i, g_p); break; case PLAYER_ROTSCRNANG: if (iSet) - g_player[iPlayer].ps.rotscrnang=lValue; + g_player[iPlayer].ps->rotscrnang=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.rotscrnang, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->rotscrnang, g_i, g_p); break; case PLAYER_DEAD_FLAG: if (iSet) - g_player[iPlayer].ps.dead_flag=lValue; + g_player[iPlayer].ps->dead_flag=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.dead_flag, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->dead_flag, g_i, g_p); break; case PLAYER_SHOW_EMPTY_WEAPON: if (iSet) - g_player[iPlayer].ps.show_empty_weapon=lValue; + g_player[iPlayer].ps->show_empty_weapon=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.show_empty_weapon, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->show_empty_weapon, g_i, g_p); break; case PLAYER_SCUBA_AMOUNT: if (iSet) - g_player[iPlayer].ps.scuba_amount=lValue; + g_player[iPlayer].ps->scuba_amount=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.scuba_amount, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->scuba_amount, g_i, g_p); break; case PLAYER_JETPACK_AMOUNT: if (iSet) - g_player[iPlayer].ps.jetpack_amount=lValue; + g_player[iPlayer].ps->jetpack_amount=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.jetpack_amount, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->jetpack_amount, g_i, g_p); break; case PLAYER_STEROIDS_AMOUNT: if (iSet) - g_player[iPlayer].ps.steroids_amount=lValue; + g_player[iPlayer].ps->steroids_amount=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.steroids_amount, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->steroids_amount, g_i, g_p); break; case PLAYER_SHIELD_AMOUNT: if (iSet) - g_player[iPlayer].ps.shield_amount=lValue; + g_player[iPlayer].ps->shield_amount=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.shield_amount, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->shield_amount, g_i, g_p); break; case PLAYER_HOLODUKE_ON: if (iSet) - g_player[iPlayer].ps.holoduke_on=lValue; + g_player[iPlayer].ps->holoduke_on=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.holoduke_on, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->holoduke_on, g_i, g_p); break; case PLAYER_PYCOUNT: if (iSet) - g_player[iPlayer].ps.pycount=lValue; + g_player[iPlayer].ps->pycount=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.pycount, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->pycount, g_i, g_p); break; case PLAYER_WEAPON_POS: if (iSet) - g_player[iPlayer].ps.weapon_pos=lValue; + g_player[iPlayer].ps->weapon_pos=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.weapon_pos, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->weapon_pos, g_i, g_p); break; case PLAYER_FRAG_PS: if (iSet) - g_player[iPlayer].ps.frag_ps=lValue; + g_player[iPlayer].ps->frag_ps=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.frag_ps, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->frag_ps, g_i, g_p); break; case PLAYER_TRANSPORTER_HOLD: if (iSet) - g_player[iPlayer].ps.transporter_hold=lValue; + g_player[iPlayer].ps->transporter_hold=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.transporter_hold, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->transporter_hold, g_i, g_p); break; case PLAYER_LAST_FULL_WEAPON: if (iSet) - g_player[iPlayer].ps.last_full_weapon=lValue; + g_player[iPlayer].ps->last_full_weapon=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.last_full_weapon, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->last_full_weapon, g_i, g_p); break; case PLAYER_FOOTPRINTSHADE: if (iSet) - g_player[iPlayer].ps.footprintshade=lValue; + g_player[iPlayer].ps->footprintshade=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.footprintshade, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->footprintshade, g_i, g_p); break; case PLAYER_BOOT_AMOUNT: if (iSet) - g_player[iPlayer].ps.boot_amount=lValue; + g_player[iPlayer].ps->boot_amount=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.boot_amount, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->boot_amount, g_i, g_p); break; case PLAYER_SCREAM_VOICE: if (iSet) - g_player[iPlayer].ps.scream_voice=lValue; + g_player[iPlayer].ps->scream_voice=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.scream_voice, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->scream_voice, g_i, g_p); break; case PLAYER_GM: if (iSet) - g_player[iPlayer].ps.gm=lValue; + g_player[iPlayer].ps->gm=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.gm, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->gm, g_i, g_p); break; case PLAYER_ON_WARPING_SECTOR: if (iSet) - g_player[iPlayer].ps.on_warping_sector=lValue; + g_player[iPlayer].ps->on_warping_sector=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.on_warping_sector, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->on_warping_sector, g_i, g_p); break; case PLAYER_FOOTPRINTCOUNT: if (iSet) - g_player[iPlayer].ps.footprintcount=lValue; + g_player[iPlayer].ps->footprintcount=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.footprintcount, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->footprintcount, g_i, g_p); break; case PLAYER_HBOMB_ON: if (iSet) - g_player[iPlayer].ps.hbomb_on=lValue; + g_player[iPlayer].ps->hbomb_on=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.hbomb_on, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->hbomb_on, g_i, g_p); break; case PLAYER_JUMPING_TOGGLE: if (iSet) - g_player[iPlayer].ps.jumping_toggle=lValue; + g_player[iPlayer].ps->jumping_toggle=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.jumping_toggle, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->jumping_toggle, g_i, g_p); break; case PLAYER_RAPID_FIRE_HOLD: if (iSet) - g_player[iPlayer].ps.rapid_fire_hold=lValue; + g_player[iPlayer].ps->rapid_fire_hold=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.rapid_fire_hold, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->rapid_fire_hold, g_i, g_p); break; case PLAYER_ON_GROUND: if (iSet) - g_player[iPlayer].ps.on_ground=lValue; + g_player[iPlayer].ps->on_ground=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.on_ground, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->on_ground, g_i, g_p); break; case PLAYER_NAME: if (iSet) - g_player[iPlayer].ps.name[32]=lValue; + g_player[iPlayer].ps->name[32]=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.name[32], g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->name[32], g_i, g_p); break; case PLAYER_INVEN_ICON: if (iSet) - g_player[iPlayer].ps.inven_icon=lValue; + g_player[iPlayer].ps->inven_icon=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.inven_icon, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->inven_icon, g_i, g_p); break; case PLAYER_BUTTONPALETTE: if (iSet) - g_player[iPlayer].ps.buttonpalette=lValue; + g_player[iPlayer].ps->buttonpalette=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.buttonpalette, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->buttonpalette, g_i, g_p); break; case PLAYER_JETPACK_ON: if (iSet) - g_player[iPlayer].ps.jetpack_on=lValue; + g_player[iPlayer].ps->jetpack_on=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.jetpack_on, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->jetpack_on, g_i, g_p); break; case PLAYER_SPRITEBRIDGE: if (iSet) - g_player[iPlayer].ps.spritebridge=lValue; + g_player[iPlayer].ps->spritebridge=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.spritebridge, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->spritebridge, g_i, g_p); break; case PLAYER_LASTRANDOMSPOT: if (iSet) - g_player[iPlayer].ps.lastrandomspot=lValue; + g_player[iPlayer].ps->lastrandomspot=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.lastrandomspot, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->lastrandomspot, g_i, g_p); break; case PLAYER_SCUBA_ON: if (iSet) - g_player[iPlayer].ps.scuba_on=lValue; + g_player[iPlayer].ps->scuba_on=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.scuba_on, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->scuba_on, g_i, g_p); break; case PLAYER_FOOTPRINTPAL: if (iSet) - g_player[iPlayer].ps.footprintpal=lValue; + g_player[iPlayer].ps->footprintpal=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.footprintpal, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->footprintpal, g_i, g_p); break; case PLAYER_HEAT_ON: if (iSet) { - if (g_player[iPlayer].ps.heat_on != lValue) + if (g_player[iPlayer].ps->heat_on != lValue) { - g_player[iPlayer].ps.heat_on=lValue; - setpal(&g_player[iPlayer].ps); + g_player[iPlayer].ps->heat_on=lValue; + setpal(g_player[iPlayer].ps); } } else - SetGameVarID(lVar2, g_player[iPlayer].ps.heat_on, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->heat_on, g_i, g_p); break; case PLAYER_HOLSTER_WEAPON: if (iSet) - g_player[iPlayer].ps.holster_weapon=lValue; + g_player[iPlayer].ps->holster_weapon=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.holster_weapon, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->holster_weapon, g_i, g_p); break; case PLAYER_FALLING_COUNTER: if (iSet) - g_player[iPlayer].ps.falling_counter=lValue; + g_player[iPlayer].ps->falling_counter=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.falling_counter, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->falling_counter, g_i, g_p); break; case PLAYER_GOTWEAPON: lTemp=lParm2; if (iSet) - g_player[iPlayer].ps.gotweapon[lTemp]=lValue; + g_player[iPlayer].ps->gotweapon[lTemp]=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.gotweapon[lTemp], g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->gotweapon[lTemp], g_i, g_p); break; case PLAYER_REFRESH_INVENTORY: if (iSet) - g_player[iPlayer].ps.refresh_inventory=lValue; + g_player[iPlayer].ps->refresh_inventory=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.refresh_inventory, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->refresh_inventory, g_i, g_p); break; // case PLAYER_PALETTE: // if(iSet) // { - // g_player[iPlayer].ps.palette=lValue; + // g_player[iPlayer].ps->palette=lValue; // } // else // { - // SetGameVarID(lVar2, g_player[iPlayer].ps.palette, g_i, g_p); + // SetGameVarID(lVar2, g_player[iPlayer].ps->palette, g_i, g_p); // } // break; case PLAYER_TOGGLE_KEY_FLAG: if (iSet) - g_player[iPlayer].ps.toggle_key_flag=lValue; + g_player[iPlayer].ps->toggle_key_flag=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.toggle_key_flag, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->toggle_key_flag, g_i, g_p); break; case PLAYER_KNUCKLE_INCS: if (iSet) - g_player[iPlayer].ps.knuckle_incs=lValue; + g_player[iPlayer].ps->knuckle_incs=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.knuckle_incs, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->knuckle_incs, g_i, g_p); break; case PLAYER_WALKING_SND_TOGGLE: if (iSet) - g_player[iPlayer].ps.walking_snd_toggle=lValue; + g_player[iPlayer].ps->walking_snd_toggle=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.walking_snd_toggle, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->walking_snd_toggle, g_i, g_p); break; case PLAYER_PALOOKUP: if (iSet) - g_player[iPlayer].ps.palookup=lValue; + g_player[iPlayer].ps->palookup=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.palookup, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->palookup, g_i, g_p); break; case PLAYER_HARD_LANDING: if (iSet) - g_player[iPlayer].ps.hard_landing=lValue; + g_player[iPlayer].ps->hard_landing=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.hard_landing, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->hard_landing, g_i, g_p); break; case PLAYER_MAX_SECRET_ROOMS: if (iSet) - g_player[iPlayer].ps.max_secret_rooms=lValue; + g_player[iPlayer].ps->max_secret_rooms=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.max_secret_rooms, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->max_secret_rooms, g_i, g_p); break; case PLAYER_SECRET_ROOMS: if (iSet) - g_player[iPlayer].ps.secret_rooms=lValue; + g_player[iPlayer].ps->secret_rooms=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.secret_rooms, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->secret_rooms, g_i, g_p); break; case PLAYER_PALS: lTemp=lParm2; if (iSet) - g_player[iPlayer].ps.pals[lTemp]=lValue; + g_player[iPlayer].ps->pals[lTemp]=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.pals[lTemp], g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->pals[lTemp], g_i, g_p); break; case PLAYER_MAX_ACTORS_KILLED: if (iSet) - g_player[iPlayer].ps.max_actors_killed=lValue; + g_player[iPlayer].ps->max_actors_killed=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.max_actors_killed, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->max_actors_killed, g_i, g_p); break; case PLAYER_ACTORS_KILLED: if (iSet) - g_player[iPlayer].ps.actors_killed=lValue; + g_player[iPlayer].ps->actors_killed=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.actors_killed, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->actors_killed, g_i, g_p); break; case PLAYER_RETURN_TO_CENTER: if (iSet) - g_player[iPlayer].ps.return_to_center=lValue; + g_player[iPlayer].ps->return_to_center=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.return_to_center, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->return_to_center, g_i, g_p); break; case PLAYER_RUNSPEED: if (iSet) - g_player[iPlayer].ps.runspeed=lValue; + g_player[iPlayer].ps->runspeed=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.runspeed, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->runspeed, g_i, g_p); break; case PLAYER_SBS: if (iSet) - g_player[iPlayer].ps.sbs=lValue; + g_player[iPlayer].ps->sbs=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.sbs, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->sbs, g_i, g_p); break; case PLAYER_RELOADING: if (iSet) - g_player[iPlayer].ps.reloading=lValue; + g_player[iPlayer].ps->reloading=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.reloading, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->reloading, g_i, g_p); break; case PLAYER_AUTO_AIM: if (iSet) - g_player[iPlayer].ps.auto_aim=lValue; + g_player[iPlayer].ps->auto_aim=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.auto_aim, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->auto_aim, g_i, g_p); break; case PLAYER_MOVEMENT_LOCK: if (iSet) - g_player[iPlayer].ps.movement_lock=lValue; + g_player[iPlayer].ps->movement_lock=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.movement_lock, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->movement_lock, g_i, g_p); break; case PLAYER_SOUND_PITCH: if (iSet) - g_player[iPlayer].ps.sound_pitch=lValue; + g_player[iPlayer].ps->sound_pitch=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.sound_pitch, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->sound_pitch, g_i, g_p); break; case PLAYER_WEAPONSWITCH: if (iSet) - g_player[iPlayer].ps.weaponswitch=lValue; + g_player[iPlayer].ps->weaponswitch=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.weaponswitch, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->weaponswitch, g_i, g_p); break; case PLAYER_TEAM: if (iSet) - g_player[iPlayer].ps.team=lValue; + g_player[iPlayer].ps->team=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].ps.team, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].ps->team, g_i, g_p); break; default: @@ -1966,10 +1967,11 @@ static void DoInput(int iSet, int lVar1, int lLabelID, int lVar2) if (lVar1 != g_iThisActorID) iPlayer=GetGameVarID(lVar1, g_i, g_p); - if (iPlayer<0 || iPlayer >= MAXPLAYERS) + if (iPlayer<0 || iPlayer >= ud.multimode) { if (lVar2 == MAXGAMEVARS) insptr++; + OSD_Printf("DoInput(): invalid target player (%d) %d\n",iPlayer,g_i); return; } @@ -1979,44 +1981,44 @@ static void DoInput(int iSet, int lVar1, int lLabelID, int lVar2) { case INPUT_AVEL: if (iSet) - g_player[iPlayer].sync.avel=lValue; + g_player[iPlayer].sync->avel=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].sync.avel, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].sync->avel, g_i, g_p); break; case INPUT_HORZ: if (iSet) - g_player[iPlayer].sync.horz=lValue; + g_player[iPlayer].sync->horz=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].sync.horz, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].sync->horz, g_i, g_p); break; case INPUT_FVEL: if (iSet) - g_player[iPlayer].sync.fvel=lValue; + g_player[iPlayer].sync->fvel=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].sync.fvel, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].sync->fvel, g_i, g_p); break; case INPUT_SVEL: if (iSet) - g_player[iPlayer].sync.svel=lValue; + g_player[iPlayer].sync->svel=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].sync.svel, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].sync->svel, g_i, g_p); break; case INPUT_BITS: if (iSet) - g_player[iPlayer].sync.bits=lValue; + g_player[iPlayer].sync->bits=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].sync.bits, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].sync->bits, g_i, g_p); break; case INPUT_EXTBITS: if (iSet) - g_player[iPlayer].sync.extbits=lValue; + g_player[iPlayer].sync->extbits=lValue; else - SetGameVarID(lVar2, g_player[iPlayer].sync.extbits, g_i, g_p); + SetGameVarID(lVar2, g_player[iPlayer].sync->extbits, g_i, g_p); break; default: break; @@ -2973,8 +2975,8 @@ void OnEvent(int iEventID, int iActor, int iPlayer, long lDist) // if player was set to squish, first stop that... if (g_p >= 0) { - if (g_player[g_p].ps.actorsqu == g_i) - g_player[g_p].ps.actorsqu = -1; + if (g_player[g_p].ps->actorsqu == g_i) + g_player[g_p].ps->actorsqu = -1; } deletesprite(g_i); } @@ -3011,7 +3013,7 @@ static int ifsquished(int i, int p) if (squishme) { - FTA(10,&g_player[p].ps); + FTA(10,g_player[p].ps); if (badguy(&sprite[i])) sprite[i].xvel = 0; @@ -3238,7 +3240,7 @@ static void alterang(int a) { int aang = g_sp->ang, angdif, goalang; long ticselapsed = (g_t[0])&31, *moveptr = (long *)g_t[1]; - int j = g_player[g_p].ps.holoduke_on; + int j = g_player[g_p].ps->holoduke_on; g_sp->xvel += (*moveptr-g_sp->xvel)/5; if (g_sp->zvel < 648) g_sp->zvel += ((*(moveptr+1)<<4)-g_sp->zvel)/5; @@ -3249,7 +3251,7 @@ static void alterang(int a) if (j >= 0 && cansee(sprite[j].x,sprite[j].y,sprite[j].z,sprite[j].sectnum,g_sp->x,g_sp->y,g_sp->z,g_sp->sectnum)) g_sp->owner = j; - else g_sp->owner = g_player[g_p].ps.i; + else g_sp->owner = g_player[g_p].ps->i; if (sprite[g_sp->owner].picnum == APLAYER) goalang = getangle(hittype[g_i].lastvx-g_sp->x,hittype[g_i].lastvy-g_sp->y); @@ -3286,7 +3288,7 @@ static void alterang(int a) { goalang = furthestangle(g_i,j); g_sp->ang = goalang; - g_sp->owner = g_player[g_p].ps.i; + g_sp->owner = g_player[g_p].ps->i; } if (a&fleeenemy) @@ -3309,9 +3311,9 @@ static void move(void) if (a&face_player) { - if (g_player[g_p].ps.newowner >= 0) - goalang = getangle(g_player[g_p].ps.oposx-g_sp->x,g_player[g_p].ps.oposy-g_sp->y); - else goalang = getangle(g_player[g_p].ps.posx-g_sp->x,g_player[g_p].ps.posy-g_sp->y); + if (g_player[g_p].ps->newowner >= 0) + goalang = getangle(g_player[g_p].ps->oposx-g_sp->x,g_player[g_p].ps->oposy-g_sp->y); + else goalang = getangle(g_player[g_p].ps->posx-g_sp->x,g_player[g_p].ps->posy-g_sp->y); angdif = getincangle(g_sp->ang,goalang)>>2; if ((angdif > -8 && angdif < 0) || (angdif < 8 && angdif > 0)) angdif *= 2; @@ -3323,9 +3325,9 @@ static void move(void) if (a&face_player_slow) { - if (g_player[g_p].ps.newowner >= 0) - goalang = getangle(g_player[g_p].ps.oposx-g_sp->x,g_player[g_p].ps.oposy-g_sp->y); - else goalang = getangle(g_player[g_p].ps.posx-g_sp->x,g_player[g_p].ps.posy-g_sp->y); + if (g_player[g_p].ps->newowner >= 0) + goalang = getangle(g_player[g_p].ps->oposx-g_sp->x,g_player[g_p].ps->oposy-g_sp->y); + else goalang = getangle(g_player[g_p].ps->posx-g_sp->x,g_player[g_p].ps->posy-g_sp->y); angdif = getincangle(g_sp->ang,goalang)>>4; if ((angdif > -8 && angdif < 0) || (angdif < 8 && angdif > 0)) angdif *= 2; @@ -3340,8 +3342,8 @@ static void move(void) if (a&face_player_smart) { - long newx = g_player[g_p].ps.posx+(g_player[g_p].ps.posxv/768); - long newy = g_player[g_p].ps.posy+(g_player[g_p].ps.posyv/768); + long newx = g_player[g_p].ps->posx+(g_player[g_p].ps->posxv/768); + long newy = g_player[g_p].ps->posy+(g_player[g_p].ps->posyv/768); goalang = getangle(newx-g_sp->x,newy-g_sp->y); angdif = getincangle(g_sp->ang,goalang)>>2; @@ -3445,29 +3447,29 @@ static void move(void) { daxvel = -(1024-g_x); - angdif = getangle(g_player[g_p].ps.posx-g_sp->x,g_player[g_p].ps.posy-g_sp->y); + angdif = getangle(g_player[g_p].ps->posx-g_sp->x,g_player[g_p].ps->posy-g_sp->y); if (g_x < 512) { - g_player[g_p].ps.posxv = 0; - g_player[g_p].ps.posyv = 0; + g_player[g_p].ps->posxv = 0; + g_player[g_p].ps->posyv = 0; } else { - g_player[g_p].ps.posxv = mulscale(g_player[g_p].ps.posxv,g_player[g_p].ps.runspeed-0x2000,16); - g_player[g_p].ps.posyv = mulscale(g_player[g_p].ps.posyv,g_player[g_p].ps.runspeed-0x2000,16); + g_player[g_p].ps->posxv = mulscale(g_player[g_p].ps->posxv,g_player[g_p].ps->runspeed-0x2000,16); + g_player[g_p].ps->posyv = mulscale(g_player[g_p].ps->posyv,g_player[g_p].ps->runspeed-0x2000,16); } } else if (g_sp->picnum != DRONE && g_sp->picnum != SHARK && g_sp->picnum != COMMANDER) { if (hittype[g_i].bposz != g_sp->z || (ud.multimode < 2 && ud.player_skill < 2)) { - if ((g_t[0]&1) || g_player[g_p].ps.actorsqu == g_i) return; + if ((g_t[0]&1) || g_player[g_p].ps->actorsqu == g_i) return; else daxvel <<= 1; } else { - if ((g_t[0]&3) || g_player[g_p].ps.actorsqu == g_i) return; + if ((g_t[0]&3) || g_player[g_p].ps->actorsqu == g_i) return; else daxvel <<= 2; } } @@ -3611,7 +3613,7 @@ static int parse(void) break; case CON_IFCANSEETARGET: - j = cansee(g_sp->x,g_sp->y,g_sp->z-((TRAND&41)<<8),g_sp->sectnum,g_player[g_p].ps.posx,g_player[g_p].ps.posy,g_player[g_p].ps.posz/*-((TRAND&41)<<8)*/,sprite[g_player[g_p].ps.i].sectnum); + j = cansee(g_sp->x,g_sp->y,g_sp->z-((TRAND&41)<<8),g_sp->sectnum,g_player[g_p].ps->posx,g_player[g_p].ps->posy,g_player[g_p].ps->posz/*-((TRAND&41)<<8)*/,sprite[g_player[g_p].ps->i].sectnum); parseifelse(j); if (j) hittype[g_i].timetosleep = SLEEPTIME; break; @@ -3627,9 +3629,9 @@ static int parse(void) // select sprite for monster to target // if holoduke is on, let them target holoduke first. // - if (g_player[g_p].ps.holoduke_on >= 0) + if (g_player[g_p].ps->holoduke_on >= 0) { - s = &sprite[g_player[g_p].ps.holoduke_on]; + s = &sprite[g_player[g_p].ps->holoduke_on]; j = cansee(g_sp->x,g_sp->y,g_sp->z-(TRAND&((32<<8)-1)),g_sp->sectnum, s->x,s->y,s->z,s->sectnum); @@ -3637,10 +3639,10 @@ static int parse(void) { // they can't see player's holoduke // check for player... - s = &sprite[g_player[g_p].ps.i]; + s = &sprite[g_player[g_p].ps->i]; } } - else s = &sprite[g_player[g_p].ps.i]; // holoduke not on. look for player + else s = &sprite[g_player[g_p].ps->i]; // holoduke not on. look for player // can they see player, (or player's holoduke) j = cansee(g_sp->x,g_sp->y,g_sp->z-(TRAND&((47<<8))),g_sp->sectnum, @@ -3752,15 +3754,15 @@ static int parse(void) { if (*insptr == 0) { - for (j=0;j < g_player[g_p].ps.weapreccnt;j++) - if (g_player[g_p].ps.weaprecs[j] == g_sp->picnum) + for (j=0;j < g_player[g_p].ps->weapreccnt;j++) + if (g_player[g_p].ps->weaprecs[j] == g_sp->picnum) break; - parseifelse(j < g_player[g_p].ps.weapreccnt && g_sp->owner == g_i); + parseifelse(j < g_player[g_p].ps->weapreccnt && g_sp->owner == g_i); } - else if (g_player[g_p].ps.weapreccnt < 16) + else if (g_player[g_p].ps->weapreccnt < 16) { - g_player[g_p].ps.weaprecs[g_player[g_p].ps.weapreccnt++] = g_sp->picnum; + g_player[g_p].ps->weaprecs[g_player[g_p].ps->weapreccnt++] = g_sp->picnum; parseifelse(g_sp->owner == g_i); } else parseifelse(0); @@ -3771,14 +3773,14 @@ static int parse(void) case CON_GETLASTPAL: insptr++; if (g_sp->picnum == APLAYER) - g_sp->pal = g_player[g_sp->yvel].ps.palookup; + g_sp->pal = g_player[g_sp->yvel].ps->palookup; else g_sp->pal = hittype[g_i].tempang; hittype[g_i].tempang = 0; break; case CON_TOSSWEAPON: insptr++; - checkweapons(&g_player[g_sp->yvel].ps); + checkweapons(g_player[g_sp->yvel].ps); break; case CON_NULLOP: @@ -3796,11 +3798,11 @@ static int parse(void) if (ud.multimode > 1 && g_sp->picnum == APLAYER) { - if (g_player[otherp].ps.quick_kick == 0) - g_player[otherp].ps.quick_kick = 14; + if (g_player[otherp].ps->quick_kick == 0) + g_player[otherp].ps->quick_kick = 14; } - else if (g_sp->picnum != APLAYER && g_player[g_p].ps.quick_kick == 0) - g_player[g_p].ps.quick_kick = 14; + else if (g_sp->picnum != APLAYER && g_player[g_p].ps->quick_kick == 0) + g_player[g_p].ps->quick_kick = 14; break; case CON_SIZETO: @@ -3852,7 +3854,7 @@ static int parse(void) case CON_GLOBALSOUND: insptr++; if (g_p == screenpeek || (gametype_flags[ud.coop]&GAMETYPE_FLAG_COOPSOUND)) - spritesound((short) *insptr,g_player[screenpeek].ps.i); + spritesound((short) *insptr,g_player[screenpeek].ps->i); insptr++; break; @@ -3863,7 +3865,7 @@ static int parse(void) case CON_TIP: insptr++; - g_player[g_p].ps.tipincs = 26; + g_player[g_p].ps->tipincs = 26; break; case CON_FALL: @@ -3960,17 +3962,17 @@ static int parse(void) return 1; case CON_ADDAMMO: insptr++; - if (g_player[g_p].ps.ammo_amount[*insptr] >= max_ammo_amount[*insptr]) + if (g_player[g_p].ps->ammo_amount[*insptr] >= max_ammo_amount[*insptr]) { killit_flag = 2; break; } - addammo(*insptr, &g_player[g_p].ps, *(insptr+1)); - if (g_player[g_p].ps.curr_weapon == KNEE_WEAPON) - if (g_player[g_p].ps.gotweapon[*insptr]) + addammo(*insptr, g_player[g_p].ps, *(insptr+1)); + if (g_player[g_p].ps->curr_weapon == KNEE_WEAPON) + if (g_player[g_p].ps->gotweapon[*insptr]) { - if (!(g_player[g_p].ps.weaponswitch & 1)) addweaponnoswitch(&g_player[g_p].ps, *insptr); - else addweapon(&g_player[g_p].ps, *insptr); + if (!(g_player[g_p].ps->weaponswitch & 1)) addweaponnoswitch(g_player[g_p].ps, *insptr); + else addweapon(g_player[g_p].ps, *insptr); } insptr += 2; break; @@ -3997,7 +3999,7 @@ static int parse(void) case CON_ADDKILLS: insptr++; - g_player[g_p].ps.actors_killed += *insptr++; + g_player[g_p].ps->actors_killed += *insptr++; hittype[g_i].actorstayput = -1; break; @@ -4013,22 +4015,22 @@ static int parse(void) case CON_ADDWEAPON: insptr++; - if (g_player[g_p].ps.gotweapon[*insptr] == 0) + if (g_player[g_p].ps->gotweapon[*insptr] == 0) { - if (!(g_player[g_p].ps.weaponswitch & 1)) addweaponnoswitch(&g_player[g_p].ps, *insptr); - else addweapon(&g_player[g_p].ps, *insptr); + if (!(g_player[g_p].ps->weaponswitch & 1)) addweaponnoswitch(g_player[g_p].ps, *insptr); + else addweapon(g_player[g_p].ps, *insptr); } - else if (g_player[g_p].ps.ammo_amount[*insptr] >= max_ammo_amount[*insptr]) + else if (g_player[g_p].ps->ammo_amount[*insptr] >= max_ammo_amount[*insptr]) { killit_flag = 2; break; } - addammo(*insptr, &g_player[g_p].ps, *(insptr+1)); - if (g_player[g_p].ps.curr_weapon == KNEE_WEAPON) - if (g_player[g_p].ps.gotweapon[*insptr]) + addammo(*insptr, g_player[g_p].ps, *(insptr+1)); + if (g_player[g_p].ps->curr_weapon == KNEE_WEAPON) + if (g_player[g_p].ps->gotweapon[*insptr]) { - if (!(g_player[g_p].ps.weaponswitch & 1)) addweaponnoswitch(&g_player[g_p].ps, *insptr); - else addweapon(&g_player[g_p].ps, *insptr); + if (!(g_player[g_p].ps->weaponswitch & 1)) addweaponnoswitch(g_player[g_p].ps, *insptr); + else addweapon(g_player[g_p].ps, *insptr); } insptr+=2; break; @@ -4040,23 +4042,23 @@ static int parse(void) case CON_ENDOFGAME: insptr++; - g_player[g_p].ps.timebeforeexit = *insptr++; - g_player[g_p].ps.customexitsound = -1; + g_player[g_p].ps->timebeforeexit = *insptr++; + g_player[g_p].ps->customexitsound = -1; ud.eog = 1; break; case CON_ADDPHEALTH: insptr++; - if (g_player[g_p].ps.newowner >= 0) + if (g_player[g_p].ps->newowner >= 0) { - g_player[g_p].ps.newowner = -1; - g_player[g_p].ps.posx = g_player[g_p].ps.oposx; - g_player[g_p].ps.posy = g_player[g_p].ps.oposy; - g_player[g_p].ps.posz = g_player[g_p].ps.oposz; - g_player[g_p].ps.ang = g_player[g_p].ps.oang; - updatesector(g_player[g_p].ps.posx,g_player[g_p].ps.posy,&g_player[g_p].ps.cursectnum); - setpal(&g_player[g_p].ps); + g_player[g_p].ps->newowner = -1; + g_player[g_p].ps->posx = g_player[g_p].ps->oposx; + g_player[g_p].ps->posy = g_player[g_p].ps->oposy; + g_player[g_p].ps->posz = g_player[g_p].ps->oposz; + g_player[g_p].ps->ang = g_player[g_p].ps->oang; + updatesector(g_player[g_p].ps->posx,g_player[g_p].ps->posy,&g_player[g_p].ps->cursectnum); + setpal(g_player[g_p].ps); j = headspritestat[1]; while (j >= 0) @@ -4067,7 +4069,7 @@ static int parse(void) } } - j = sprite[g_player[g_p].ps.i].extra; + j = sprite[g_player[g_p].ps->i].extra; if (g_sp->picnum != ATOMICHEALTH) { @@ -4100,12 +4102,12 @@ static int parse(void) { if ((j - *insptr) < (max_player_health>>2) && j >= (max_player_health>>2)) - spritesound(DUKE_GOTHEALTHATLOW,g_player[g_p].ps.i); + spritesound(DUKE_GOTHEALTHATLOW,g_player[g_p].ps->i); - g_player[g_p].ps.last_extra = j; + g_player[g_p].ps->last_extra = j; } - sprite[g_player[g_p].ps.i].extra = j; + sprite[g_player[g_p].ps->i].extra = j; } insptr++; @@ -4137,22 +4139,22 @@ static int parse(void) case CON_ADDWEAPONVAR: insptr++; - if (g_player[g_p].ps.gotweapon[GetGameVarID(*(insptr),g_i,g_p)] == 0) + if (g_player[g_p].ps->gotweapon[GetGameVarID(*(insptr),g_i,g_p)] == 0) { - if (!(g_player[g_p].ps.weaponswitch & 1)) addweaponnoswitch(&g_player[g_p].ps, GetGameVarID(*(insptr),g_i,g_p)); - else addweapon(&g_player[g_p].ps, GetGameVarID(*(insptr),g_i,g_p)); + if (!(g_player[g_p].ps->weaponswitch & 1)) addweaponnoswitch(g_player[g_p].ps, GetGameVarID(*(insptr),g_i,g_p)); + else addweapon(g_player[g_p].ps, GetGameVarID(*(insptr),g_i,g_p)); } - else if (g_player[g_p].ps.ammo_amount[GetGameVarID(*(insptr),g_i,g_p)] >= max_ammo_amount[GetGameVarID(*(insptr),g_i,g_p)]) + else if (g_player[g_p].ps->ammo_amount[GetGameVarID(*(insptr),g_i,g_p)] >= max_ammo_amount[GetGameVarID(*(insptr),g_i,g_p)]) { killit_flag = 2; break; } - addammo(GetGameVarID(*(insptr),g_i,g_p), &g_player[g_p].ps, GetGameVarID(*(insptr+1),g_i,g_p)); - if (g_player[g_p].ps.curr_weapon == KNEE_WEAPON) - if (g_player[g_p].ps.gotweapon[GetGameVarID(*(insptr),g_i,g_p)]) + addammo(GetGameVarID(*(insptr),g_i,g_p), g_player[g_p].ps, GetGameVarID(*(insptr+1),g_i,g_p)); + if (g_player[g_p].ps->curr_weapon == KNEE_WEAPON) + if (g_player[g_p].ps->gotweapon[GetGameVarID(*(insptr),g_i,g_p)]) { - if (!(g_player[g_p].ps.weaponswitch & 1)) addweaponnoswitch(&g_player[g_p].ps, GetGameVarID(*(insptr),g_i,g_p)); - else addweapon(&g_player[g_p].ps, GetGameVarID(*(insptr),g_i,g_p)); + if (!(g_player[g_p].ps->weaponswitch & 1)) addweaponnoswitch(g_player[g_p].ps, GetGameVarID(*(insptr),g_i,g_p)); + else addweapon(g_player[g_p].ps, GetGameVarID(*(insptr),g_i,g_p)); } insptr+=2; break; @@ -4354,7 +4356,7 @@ static int parse(void) mpchangemap(volnume,levnume); else { - g_player[myconnectindex].ps.gm |= MODE_EOL; + g_player[myconnectindex].ps->gm |= MODE_EOL; display_bonus_screen = 0; } // MODE_RESTART; @@ -4651,7 +4653,7 @@ static int parse(void) spritesound((short)j,g_i); break; case CON_GLOBALSOUNDVAR: - spritesound((short)j,g_player[screenpeek].ps.i); + spritesound((short)j,g_player[screenpeek].ps->i); break; case CON_STOPSOUNDVAR: if (isspritemakingsound(g_i,j)) @@ -4720,7 +4722,7 @@ static int parse(void) setview(x1,y1,x2,y2); #if 0 - if (!ud.pause_on && ((ud.show_help == 0 && ud.multimode < 2 && !(g_player[myconnectindex].ps.gm&MODE_MENU)) || ud.multimode > 1 || ud.recstat == 2)) + if (!ud.pause_on && ((ud.show_help == 0 && ud.multimode < 2 && !(g_player[myconnectindex].ps->gm&MODE_MENU)) || ud.multimode > 1 || ud.recstat == 2)) smoothratio = min(max((totalclock-ototalclock)*(65536L/TICSPERFRAME),0),65536); #endif dointerpolations(smoothratio); @@ -5087,7 +5089,7 @@ static int parse(void) case CON_QUAKE: insptr++; earthquaketime = (char)GetGameVarID(*insptr++,g_i,g_p); - spritesound(EARTHQUAKE,g_player[screenpeek].ps.i); + spritesound(EARTHQUAKE,g_player[screenpeek].ps->i); break; case CON_IFMOVE: @@ -5104,21 +5106,21 @@ static int parse(void) { if (lastsavedpos >= 0 && ud.recstat != 2) { - g_player[g_p].ps.gm = MODE_MENU; + g_player[g_p].ps->gm = MODE_MENU; KB_ClearKeyDown(sc_Space); cmenu(15000); } - else g_player[g_p].ps.gm = MODE_RESTART; + else g_player[g_p].ps->gm = MODE_RESTART; killit_flag = 2; } else { pickrandomspot(g_p); - g_sp->x = hittype[g_i].bposx = g_player[g_p].ps.bobposx = g_player[g_p].ps.oposx = g_player[g_p].ps.posx; - g_sp->y = hittype[g_i].bposy = g_player[g_p].ps.bobposy = g_player[g_p].ps.oposy =g_player[g_p].ps.posy; - g_sp->z = hittype[g_i].bposy = g_player[g_p].ps.oposz =g_player[g_p].ps.posz; - updatesector(g_player[g_p].ps.posx,g_player[g_p].ps.posy,&g_player[g_p].ps.cursectnum); - setsprite(g_player[g_p].ps.i,g_player[g_p].ps.posx,g_player[g_p].ps.posy,g_player[g_p].ps.posz+PHEIGHT); + g_sp->x = hittype[g_i].bposx = g_player[g_p].ps->bobposx = g_player[g_p].ps->oposx = g_player[g_p].ps->posx; + g_sp->y = hittype[g_i].bposy = g_player[g_p].ps->bobposy = g_player[g_p].ps->oposy =g_player[g_p].ps->posy; + g_sp->z = hittype[g_i].bposy = g_player[g_p].ps->oposz =g_player[g_p].ps->posz; + updatesector(g_player[g_p].ps->posx,g_player[g_p].ps->posy,&g_player[g_p].ps->cursectnum); + setsprite(g_player[g_p].ps->i,g_player[g_p].ps->posx,g_player[g_p].ps->posy,g_player[g_p].ps->posz+PHEIGHT); g_sp->cstat = 257; g_sp->shade = -12; @@ -5127,27 +5129,27 @@ static int parse(void) g_sp->yrepeat = 36; g_sp->owner = g_i; g_sp->xoffset = 0; - g_sp->pal = g_player[g_p].ps.palookup; + g_sp->pal = g_player[g_p].ps->palookup; - g_player[g_p].ps.last_extra = g_sp->extra = max_player_health; - g_player[g_p].ps.wantweaponfire = -1; - g_player[g_p].ps.horiz = 100; - g_player[g_p].ps.on_crane = -1; - g_player[g_p].ps.frag_ps = g_p; - g_player[g_p].ps.horizoff = 0; - g_player[g_p].ps.opyoff = 0; - g_player[g_p].ps.wackedbyactor = -1; - g_player[g_p].ps.shield_amount = max_armour_amount; - g_player[g_p].ps.dead_flag = 0; - g_player[g_p].ps.pals_time = 0; - g_player[g_p].ps.footprintcount = 0; - g_player[g_p].ps.weapreccnt = 0; - g_player[g_p].ps.fta = 0; - g_player[g_p].ps.ftq = 0; - g_player[g_p].ps.posxv = g_player[g_p].ps.posyv = 0; - g_player[g_p].ps.rotscrnang = 0; - g_player[g_p].ps.runspeed = dukefriction; - g_player[g_p].ps.falling_counter = 0; + g_player[g_p].ps->last_extra = g_sp->extra = max_player_health; + g_player[g_p].ps->wantweaponfire = -1; + g_player[g_p].ps->horiz = 100; + g_player[g_p].ps->on_crane = -1; + g_player[g_p].ps->frag_ps = g_p; + g_player[g_p].ps->horizoff = 0; + g_player[g_p].ps->opyoff = 0; + g_player[g_p].ps->wackedbyactor = -1; + g_player[g_p].ps->shield_amount = max_armour_amount; + g_player[g_p].ps->dead_flag = 0; + g_player[g_p].ps->pals_time = 0; + g_player[g_p].ps->footprintcount = 0; + g_player[g_p].ps->weapreccnt = 0; + g_player[g_p].ps->fta = 0; + g_player[g_p].ps->ftq = 0; + g_player[g_p].ps->posxv = g_player[g_p].ps->posyv = 0; + g_player[g_p].ps->rotscrnang = 0; + g_player[g_p].ps->runspeed = dukefriction; + g_player[g_p].ps->falling_counter = 0; hittype[g_i].extra = -1; hittype[g_i].owner = g_i; @@ -5157,20 +5159,20 @@ static int parse(void) hittype[g_i].tempang = 0; hittype[g_i].actorstayput = -1; hittype[g_i].dispicnum = 0; - hittype[g_i].owner = g_player[g_p].ps.i; + hittype[g_i].owner = g_player[g_p].ps->i; resetinventory(g_p); resetweapons(g_p); - g_player[g_p].ps.reloading = 0; + g_player[g_p].ps->reloading = 0; - g_player[g_p].ps.movement_lock = 0; + g_player[g_p].ps->movement_lock = 0; - OnEvent(EVENT_RESETPLAYER, g_player[g_p].ps.i, g_p, -1); + OnEvent(EVENT_RESETPLAYER, g_player[g_p].ps->i, g_p, -1); cameradist = 0; cameraclock = totalclock; } - setpal(&g_player[g_p].ps); + setpal(g_player[g_p].ps); //AddLog("EOF: resetplayer"); } break; @@ -5203,59 +5205,59 @@ static int parse(void) switch (*(insptr-1)) { case GET_STEROIDS: - g_player[g_p].ps.steroids_amount = *insptr; - g_player[g_p].ps.inven_icon = 2; + g_player[g_p].ps->steroids_amount = *insptr; + g_player[g_p].ps->inven_icon = 2; break; case GET_SHIELD: - g_player[g_p].ps.shield_amount += *insptr;// 100; - if (g_player[g_p].ps.shield_amount > max_player_health) - g_player[g_p].ps.shield_amount = max_player_health; + g_player[g_p].ps->shield_amount += *insptr;// 100; + if (g_player[g_p].ps->shield_amount > max_player_health) + g_player[g_p].ps->shield_amount = max_player_health; break; case GET_SCUBA: - g_player[g_p].ps.scuba_amount = *insptr;// 1600; - g_player[g_p].ps.inven_icon = 6; + g_player[g_p].ps->scuba_amount = *insptr;// 1600; + g_player[g_p].ps->inven_icon = 6; break; case GET_HOLODUKE: - g_player[g_p].ps.holoduke_amount = *insptr;// 1600; - g_player[g_p].ps.inven_icon = 3; + g_player[g_p].ps->holoduke_amount = *insptr;// 1600; + g_player[g_p].ps->inven_icon = 3; break; case GET_JETPACK: - g_player[g_p].ps.jetpack_amount = *insptr;// 1600; - g_player[g_p].ps.inven_icon = 4; + g_player[g_p].ps->jetpack_amount = *insptr;// 1600; + g_player[g_p].ps->inven_icon = 4; break; case GET_ACCESS: switch (g_sp->pal) { case 0: - g_player[g_p].ps.got_access |= 1; + g_player[g_p].ps->got_access |= 1; break; case 21: - g_player[g_p].ps.got_access |= 2; + g_player[g_p].ps->got_access |= 2; break; case 23: - g_player[g_p].ps.got_access |= 4; + g_player[g_p].ps->got_access |= 4; break; } break; case GET_HEATS: - g_player[g_p].ps.heat_amount = *insptr; - g_player[g_p].ps.inven_icon = 5; + g_player[g_p].ps->heat_amount = *insptr; + g_player[g_p].ps->inven_icon = 5; break; case GET_FIRSTAID: - g_player[g_p].ps.inven_icon = 1; - g_player[g_p].ps.firstaid_amount = *insptr; + g_player[g_p].ps->inven_icon = 1; + g_player[g_p].ps->firstaid_amount = *insptr; break; case GET_BOOTS: - g_player[g_p].ps.inven_icon = 7; - g_player[g_p].ps.boot_amount = *insptr; + g_player[g_p].ps->inven_icon = 7; + g_player[g_p].ps->boot_amount = *insptr; break; } insptr++; @@ -5273,47 +5275,47 @@ static int parse(void) l = *insptr; j = 0; - s = sprite[g_player[g_p].ps.i].xvel; + s = sprite[g_player[g_p].ps->i].xvel; - if ((l&8) && g_player[g_p].ps.on_ground && (g_player[g_p].sync.bits&2)) + if ((l&8) && g_player[g_p].ps->on_ground && (g_player[g_p].sync->bits&2)) j = 1; - else if ((l&16) && g_player[g_p].ps.jumping_counter == 0 && !g_player[g_p].ps.on_ground && - g_player[g_p].ps.poszv > 2048) + else if ((l&16) && g_player[g_p].ps->jumping_counter == 0 && !g_player[g_p].ps->on_ground && + g_player[g_p].ps->poszv > 2048) j = 1; - else if ((l&32) && g_player[g_p].ps.jumping_counter > 348) + else if ((l&32) && g_player[g_p].ps->jumping_counter > 348) j = 1; else if ((l&1) && s >= 0 && s < 8) j = 1; - else if ((l&2) && s >= 8 && !(g_player[g_p].sync.bits&(1<<5))) + else if ((l&2) && s >= 8 && !(g_player[g_p].sync->bits&(1<<5))) j = 1; - else if ((l&4) && s >= 8 && g_player[g_p].sync.bits&(1<<5)) + else if ((l&4) && s >= 8 && g_player[g_p].sync->bits&(1<<5)) j = 1; - else if ((l&64) && g_player[g_p].ps.posz < (g_sp->z-(48<<8))) + else if ((l&64) && g_player[g_p].ps->posz < (g_sp->z-(48<<8))) j = 1; - else if ((l&128) && s <= -8 && !(g_player[g_p].sync.bits&(1<<5))) + else if ((l&128) && s <= -8 && !(g_player[g_p].sync->bits&(1<<5))) j = 1; - else if ((l&256) && s <= -8 && (g_player[g_p].sync.bits&(1<<5))) + else if ((l&256) && s <= -8 && (g_player[g_p].sync->bits&(1<<5))) j = 1; - else if ((l&512) && (g_player[g_p].ps.quick_kick > 0 || (g_player[g_p].ps.curr_weapon == KNEE_WEAPON && g_player[g_p].ps.kickback_pic > 0))) + else if ((l&512) && (g_player[g_p].ps->quick_kick > 0 || (g_player[g_p].ps->curr_weapon == KNEE_WEAPON && g_player[g_p].ps->kickback_pic > 0))) j = 1; - else if ((l&1024) && sprite[g_player[g_p].ps.i].xrepeat < 32) + else if ((l&1024) && sprite[g_player[g_p].ps->i].xrepeat < 32) j = 1; - else if ((l&2048) && g_player[g_p].ps.jetpack_on) + else if ((l&2048) && g_player[g_p].ps->jetpack_on) j = 1; - else if ((l&4096) && g_player[g_p].ps.steroids_amount > 0 && g_player[g_p].ps.steroids_amount < 400) + else if ((l&4096) && g_player[g_p].ps->steroids_amount > 0 && g_player[g_p].ps->steroids_amount < 400) j = 1; - else if ((l&8192) && g_player[g_p].ps.on_ground) + else if ((l&8192) && g_player[g_p].ps->on_ground) j = 1; - else if ((l&16384) && sprite[g_player[g_p].ps.i].xrepeat > 32 && sprite[g_player[g_p].ps.i].extra > 0 && g_player[g_p].ps.timebeforeexit == 0) + else if ((l&16384) && sprite[g_player[g_p].ps->i].xrepeat > 32 && sprite[g_player[g_p].ps->i].extra > 0 && g_player[g_p].ps->timebeforeexit == 0) j = 1; - else if ((l&32768) && sprite[g_player[g_p].ps.i].extra <= 0) + else if ((l&32768) && sprite[g_player[g_p].ps->i].extra <= 0) j = 1; else if ((l&65536L)) { if (g_sp->picnum == APLAYER && ud.multimode > 1) - j = getincangle(g_player[otherp].ps.ang,getangle(g_player[g_p].ps.posx-g_player[otherp].ps.posx,g_player[g_p].ps.posy-g_player[otherp].ps.posy)); + j = getincangle(g_player[otherp].ps->ang,getangle(g_player[g_p].ps->posx-g_player[otherp].ps->posx,g_player[g_p].ps->posy-g_player[otherp].ps->posy)); else - j = getincangle(g_player[g_p].ps.ang,getangle(g_sp->x-g_player[g_p].ps.posx,g_sp->y-g_player[g_p].ps.posy)); + j = getincangle(g_player[g_p].ps->ang,getangle(g_sp->x-g_player[g_p].ps->posx,g_sp->y-g_player[g_p].ps->posy)); if (j > -128 && j < 128) j = 1; @@ -5342,13 +5344,13 @@ static int parse(void) case CON_WACKPLAYER: insptr++; - forceplayerangle(&g_player[g_p].ps); + forceplayerangle(g_player[g_p].ps); return 0; case CON_FLASH: insptr++; sprite[g_i].shade = -127; - g_player[g_p].ps.visibility = -127; + g_player[g_p].ps->visibility = -127; lastvisinc = totalclock+32; return 0; @@ -5364,7 +5366,7 @@ static int parse(void) break; case CON_IFHITSPACE: - parseifelse(g_player[g_p].sync.bits&(1<<29)); + parseifelse(g_player[g_p].sync->bits&(1<<29)); break; case CON_IFOUTSIDE: @@ -5439,9 +5441,9 @@ static int parse(void) case CON_PALFROM: insptr++; - g_player[g_p].ps.pals_time = *insptr++; + g_player[g_p].ps->pals_time = *insptr++; for (j=0;j<3;j++) - g_player[g_p].ps.pals[j] = *insptr++; + g_player[g_p].ps->pals[j] = *insptr++; break; case CON_QSPRINTF: @@ -5879,7 +5881,7 @@ static int parse(void) case CON_LOCKPLAYER: insptr++; - g_player[g_p].ps.transporter_hold=GetGameVarID(*insptr++, g_i, g_p); + g_player[g_p].ps->transporter_hold=GetGameVarID(*insptr++, g_i, g_p); break; case CON_CHECKAVAILWEAPON: @@ -5892,23 +5894,23 @@ static int parse(void) insptr++; - if (j < MAXPLAYERS) + if (j < ud.multimode) { if (tw == CON_CHECKAVAILWEAPON) - checkavailweapon(&g_player[j].ps); - else checkavailinven(&g_player[j].ps); + checkavailweapon(g_player[j].ps); + else checkavailinven(g_player[j].ps); } break; case CON_GETPLAYERANGLE: insptr++; - SetGameVarID(*insptr++, g_player[g_p].ps.ang, g_i, g_p); + SetGameVarID(*insptr++, g_player[g_p].ps->ang, g_i, g_p); break; case CON_SETPLAYERANGLE: insptr++; - g_player[g_p].ps.ang=GetGameVarID(*insptr++, g_i, g_p); - g_player[g_p].ps.ang &= 2047; + g_player[g_p].ps->ang=GetGameVarID(*insptr++, g_i, g_p); + g_player[g_p].ps->ang &= 2047; break; case CON_GETACTORANGLE: @@ -6246,7 +6248,7 @@ static int parse(void) case CON_IFPHEALTHL: insptr++; - parseifelse(sprite[g_player[g_p].ps.i].extra < *insptr); + parseifelse(sprite[g_player[g_p].ps->i].extra < *insptr); break; case CON_IFPINVENTORY: @@ -6256,44 +6258,44 @@ static int parse(void) switch (*insptr++) { case GET_STEROIDS: - if (g_player[g_p].ps.steroids_amount != *insptr) + if (g_player[g_p].ps->steroids_amount != *insptr) j = 1; break; case GET_SHIELD: - if (g_player[g_p].ps.shield_amount != max_player_health) + if (g_player[g_p].ps->shield_amount != max_player_health) j = 1; break; case GET_SCUBA: - if (g_player[g_p].ps.scuba_amount != *insptr) j = 1; + if (g_player[g_p].ps->scuba_amount != *insptr) j = 1; break; case GET_HOLODUKE: - if (g_player[g_p].ps.holoduke_amount != *insptr) j = 1; + if (g_player[g_p].ps->holoduke_amount != *insptr) j = 1; break; case GET_JETPACK: - if (g_player[g_p].ps.jetpack_amount != *insptr) j = 1; + if (g_player[g_p].ps->jetpack_amount != *insptr) j = 1; break; case GET_ACCESS: switch (g_sp->pal) { case 0: - if (g_player[g_p].ps.got_access&1) j = 1; + if (g_player[g_p].ps->got_access&1) j = 1; break; case 21: - if (g_player[g_p].ps.got_access&2) j = 1; + if (g_player[g_p].ps->got_access&2) j = 1; break; case 23: - if (g_player[g_p].ps.got_access&4) j = 1; + if (g_player[g_p].ps->got_access&4) j = 1; break; } break; case GET_HEATS: - if (g_player[g_p].ps.heat_amount != *insptr) j = 1; + if (g_player[g_p].ps->heat_amount != *insptr) j = 1; break; case GET_FIRSTAID: - if (g_player[g_p].ps.firstaid_amount != *insptr) j = 1; + if (g_player[g_p].ps->firstaid_amount != *insptr) j = 1; break; case GET_BOOTS: - if (g_player[g_p].ps.boot_amount != *insptr) j = 1; + if (g_player[g_p].ps->boot_amount != *insptr) j = 1; break; } @@ -6303,20 +6305,20 @@ static int parse(void) case CON_PSTOMP: insptr++; - if (g_player[g_p].ps.knee_incs == 0 && sprite[g_player[g_p].ps.i].xrepeat >= 40) - if (cansee(g_sp->x,g_sp->y,g_sp->z-(4<<8),g_sp->sectnum,g_player[g_p].ps.posx,g_player[g_p].ps.posy,g_player[g_p].ps.posz+(16<<8),sprite[g_player[g_p].ps.i].sectnum)) + if (g_player[g_p].ps->knee_incs == 0 && sprite[g_player[g_p].ps->i].xrepeat >= 40) + if (cansee(g_sp->x,g_sp->y,g_sp->z-(4<<8),g_sp->sectnum,g_player[g_p].ps->posx,g_player[g_p].ps->posy,g_player[g_p].ps->posz+(16<<8),sprite[g_player[g_p].ps->i].sectnum)) { for (j=0;jactorsqu == g_i) break; } if (j == MAXPLAYERS) { - g_player[g_p].ps.knee_incs = 1; - if (g_player[g_p].ps.weapon_pos == 0) - g_player[g_p].ps.weapon_pos = -1; - g_player[g_p].ps.actorsqu = g_i; + g_player[g_p].ps->knee_incs = 1; + if (g_player[g_p].ps->weapon_pos == 0) + g_player[g_p].ps->weapon_pos = -1; + g_player[g_p].ps->actorsqu = g_i; } } break; @@ -6355,7 +6357,7 @@ static int parse(void) insptr++; break; } - FTA(*insptr++,&g_player[g_p].ps); + FTA(*insptr++,g_player[g_p].ps); break; case CON_USERQUOTE: @@ -6412,7 +6414,7 @@ static int parse(void) case CON_IFANGDIFFL: insptr++; - j = klabs(getincangle(g_player[g_p].ps.ang,g_sp->ang)); + j = klabs(getincangle(g_player[g_p].ps->ang,g_sp->ang)); parseifelse(j <= *insptr); break; @@ -6466,7 +6468,7 @@ void LoadActor(long iActor) if (g_sp->sectnum < 0 || g_sp->sectnum >= MAXSECTORS) { // if(badguy(g_sp)) - // g_player[g_p].ps.actors_killed++; + // g_player[g_p].ps->actors_killed++; deletesprite(g_i); return; } @@ -6478,8 +6480,8 @@ void LoadActor(long iActor) // if player was set to squish, first stop that... if (g_p >= 0) { - if (g_player[g_p].ps.actorsqu == g_i) - g_player[g_p].ps.actorsqu = -1; + if (g_player[g_p].ps->actorsqu == g_i) + g_player[g_p].ps->actorsqu = -1; } deletesprite(g_i); } @@ -6504,7 +6506,7 @@ void execute(int iActor,int iPlayer,long lDist) if (g_sp->sectnum < 0 || g_sp->sectnum >= MAXSECTORS) { if (badguy(g_sp)) - g_player[g_p].ps.actors_killed++; + g_player[g_p].ps->actors_killed++; deletesprite(g_i); return; } @@ -6529,8 +6531,8 @@ void execute(int iActor,int iPlayer,long lDist) if (killit_flag == 1) { // if player was set to squish, first stop that... - if (g_player[g_p].ps.actorsqu == g_i) - g_player[g_p].ps.actorsqu = -1; + if (g_player[g_p].ps->actorsqu == g_i) + g_player[g_p].ps->actorsqu = -1; deletesprite(g_i); } else diff --git a/polymer/eduke32/source/global.c b/polymer/eduke32/source/global.c index 44bc471f8..453123573 100644 --- a/polymer/eduke32/source/global.c +++ b/polymer/eduke32/source/global.c @@ -88,6 +88,7 @@ char numplayersprites,loadfromgrouponly=0,earthquaketime; long fricxv,fricyv; playerdata_t g_player[MAXPLAYERS]; input inputfifo[MOVEFIFOSIZ][MAXPLAYERS]; +player_orig g_PlayerSpawnPoints[MAXPLAYERS]; user_defs ud; char pus, pub; @@ -142,7 +143,7 @@ short weaponsandammosprites[15] = }; long impact_damage; -int condebug; +int g_ScriptDebug; //GLOBAL.C - replace the end "my's" with this long myx, omyx, myxvel, myy, omyy, myyvel, myz, omyz, myzvel; diff --git a/polymer/eduke32/source/jfaud_sounds.cpp b/polymer/eduke32/source/jfaud_sounds.cpp index 9b8aa61a9..d6a9e9339 100644 --- a/polymer/eduke32/source/jfaud_sounds.cpp +++ b/polymer/eduke32/source/jfaud_sounds.cpp @@ -365,8 +365,8 @@ int xyzsound(short num, short i, long x, long y, long z) num >= NUM_SOUNDS || ((soundm[num] & SOUNDM_PARENT) && ud.lockout) || // parental mode SoundToggle == 0 || - (g_player[myconnectindex].ps.timebeforeexit > 0 && g_player[myconnectindex].ps.timebeforeexit <= 26*3) || - (g_player[myconnectindex].ps.gm & MODE_MENU) + (g_player[myconnectindex].ps->timebeforeexit > 0 && g_player[myconnectindex].ps->timebeforeexit <= 26*3) || + (g_player[myconnectindex].ps->gm & MODE_MENU) ) return -1; if (soundm[num] & SOUNDM_PLAYER) { @@ -410,8 +410,8 @@ int xyzsound(short num, short i, long x, long y, long z) refdist *= d; } if (PN != MUSICANDSFX && - !cansee(g_player[screenpeek].ps.oposx,g_player[screenpeek].ps.oposy,g_player[screenpeek].ps.oposz-(24<<8), - g_player[screenpeek].ps.cursectnum,SX,SY,SZ-(24<<8),SECT) ) + !cansee(g_player[screenpeek].ps->oposx,g_player[screenpeek].ps->oposy,g_player[screenpeek].ps->oposz-(24<<8), + g_player[screenpeek].ps->cursectnum,SX,SY,SZ-(24<<8),SECT) ) gain *= OCCLUDEDFACTOR; switch(num) @@ -421,10 +421,10 @@ int xyzsound(short num, short i, long x, long y, long z) case RPG_EXPLODE: gain = 1.0; global = 1; - if (sector[g_player[screenpeek].ps.cursectnum].lotag == 2) pitch -= translatepitch(1024); + if (sector[g_player[screenpeek].ps->cursectnum].lotag == 2) pitch -= translatepitch(1024); break; default: - if(sector[g_player[screenpeek].ps.cursectnum].lotag == 2 && (soundm[num]&SOUNDM_DUKE) == 0) + if(sector[g_player[screenpeek].ps->cursectnum].lotag == 2 && (soundm[num]&SOUNDM_DUKE) == 0) pitch = translatepitch(-768); //if( sndist > 31444 && PN != MUSICANDSFX) // return -1; @@ -575,11 +575,11 @@ void pan3dsound(void) jfaud->AgeCache(); if(ud.camerasprite == -1) { - cx = g_player[screenpeek].ps.oposx; - cy = g_player[screenpeek].ps.oposy; - cz = g_player[screenpeek].ps.oposz; - cs = g_player[screenpeek].ps.cursectnum; - ca = g_player[screenpeek].ps.ang+g_player[screenpeek].ps.look_ang; + cx = g_player[screenpeek].ps->oposx; + cy = g_player[screenpeek].ps->oposy; + cz = g_player[screenpeek].ps->oposz; + cs = g_player[screenpeek].ps->cursectnum; + ca = g_player[screenpeek].ps->ang+g_player[screenpeek].ps->look_ang; } else { cx = sprite[ud.camerasprite].x; cy = sprite[ud.camerasprite].y; diff --git a/polymer/eduke32/source/menus.c b/polymer/eduke32/source/menus.c index d26ad68a6..767540792 100644 --- a/polymer/eduke32/source/menus.c +++ b/polymer/eduke32/source/menus.c @@ -48,7 +48,7 @@ static int curvidset, newvidset = 0; static char *mousebuttonnames[] = { "Left", "Right", "Middle", "Thumb", "Wheel Up", "Wheel Down" }; -extern int gotvote[MAXPLAYERS], votes[MAXPLAYERS], voting; +extern int voting; void cmenu(int cm) { @@ -560,7 +560,7 @@ void sendquit(void) { if (gamequit == 0 && (numplayers > 1)) { - if (g_player[myconnectindex].ps.gm&MODE_GAME) + if (g_player[myconnectindex].ps->gm&MODE_GAME) { gamequit = 1; quittimer = totalclock+120; @@ -607,14 +607,14 @@ void menus(void) buttonstat = MOUSE_GetButtons(); } - if ((g_player[myconnectindex].ps.gm&MODE_MENU) == 0) + if ((g_player[myconnectindex].ps->gm&MODE_MENU) == 0) { walock[TILE_LOADSHOT] = 1; return; } - g_player[myconnectindex].ps.gm &= (0xff-MODE_TYPE); - g_player[myconnectindex].ps.fta = 0; + g_player[myconnectindex].ps->gm &= (0xff-MODE_TYPE); + g_player[myconnectindex].ps->fta = 0; x = 0; @@ -679,7 +679,7 @@ void menus(void) ready2send = 1; totalclock = ototalclock; } - g_player[myconnectindex].ps.gm &= ~MODE_MENU; + g_player[myconnectindex].ps->gm &= ~MODE_MENU; } break; @@ -1320,7 +1320,7 @@ void menus(void) if (KB_KeyPressed(sc_Escape) || KB_KeyPressed(sc_N) || RMB) { - if (sprite[g_player[myconnectindex].ps.i].extra <= 0) + if (sprite[g_player[myconnectindex].ps->i].extra <= 0) { if (enterlevel(MODE_GAME)) backtomenu(); return; @@ -1329,7 +1329,7 @@ void menus(void) KB_ClearKeyDown(sc_N); KB_ClearKeyDown(sc_Escape); - g_player[myconnectindex].ps.gm &= ~MODE_MENU; + g_player[myconnectindex].ps->gm &= ~MODE_MENU; if (ud.multimode < 2 && ud.recstat != 2) { ready2send = 1; @@ -1346,13 +1346,13 @@ void menus(void) if (ud.multimode > 1) { loadplayer(-1-lastsavedpos); - g_player[myconnectindex].ps.gm = MODE_GAME; + g_player[myconnectindex].ps->gm = MODE_GAME; } else { c = loadplayer(lastsavedpos); if (c == 0) - g_player[myconnectindex].ps.gm = MODE_GAME; + g_player[myconnectindex].ps->gm = MODE_GAME; } } @@ -1506,10 +1506,10 @@ void menus(void) if (ud.multimode > 1) { - if (g_player[myconnectindex].ps.gm&MODE_GAME) + if (g_player[myconnectindex].ps->gm&MODE_GAME) { loadplayer(-1-lastsavedpos); - g_player[myconnectindex].ps.gm = MODE_GAME; + g_player[myconnectindex].ps->gm = MODE_GAME; } else { @@ -1532,7 +1532,7 @@ void menus(void) { c = loadplayer(lastsavedpos); if (c == 0) - g_player[myconnectindex].ps.gm = MODE_GAME; + g_player[myconnectindex].ps->gm = MODE_GAME; } break; @@ -1545,9 +1545,9 @@ void menus(void) KB_ClearKeyDown(sc_N); KB_ClearKeyDown(sc_Escape); sound(EXITMENUSOUND); - if (g_player[myconnectindex].ps.gm&MODE_GAME) + if (g_player[myconnectindex].ps->gm&MODE_GAME) { - g_player[myconnectindex].ps.gm &= ~MODE_MENU; + g_player[myconnectindex].ps->gm &= ~MODE_MENU; if (ud.multimode < 2 && ud.recstat != 2) { ready2send = 1; @@ -1579,7 +1579,7 @@ void menus(void) ready2send = 1; totalclock = ototalclock; } - g_player[myconnectindex].ps.gm &= ~MODE_MENU; + g_player[myconnectindex].ps->gm &= ~MODE_MENU; sound(EXITMENUSOUND); break; } @@ -1963,9 +1963,9 @@ cheat_for_port_credits: if (KB_KeyPressed(sc_Q)) cmenu(500); - if (x == -1 && (g_player[myconnectindex].ps.gm&MODE_GAME || ud.recstat == 2)) + if (x == -1 && (g_player[myconnectindex].ps->gm&MODE_GAME || ud.recstat == 2)) { - g_player[myconnectindex].ps.gm &= ~MODE_MENU; + g_player[myconnectindex].ps->gm &= ~MODE_MENU; if (ud.multimode < 2 && ud.recstat != 2) { ready2send = 1; @@ -2064,7 +2064,7 @@ cheat_for_port_credits: cmenu(500); break; case -1: - g_player[myconnectindex].ps.gm &= ~MODE_MENU; + g_player[myconnectindex].ps->gm &= ~MODE_MENU; if (ud.multimode < 2 && ud.recstat != 2) { ready2send = 1; @@ -2144,7 +2144,7 @@ cheat_for_port_credits: } else if (x == -1) { - if (g_player[myconnectindex].ps.gm&MODE_GAME) cmenu(50); + if (g_player[myconnectindex].ps->gm&MODE_GAME) cmenu(50); else cmenu(0); } @@ -2690,13 +2690,13 @@ cheat_for_port_credits: case 9: if (x==io) { - enabled = !((g_player[myconnectindex].ps.gm&MODE_GAME) && ud.m_recstat != 1); - if ((g_player[myconnectindex].ps.gm&MODE_GAME)) closedemowrite(); + enabled = !((g_player[myconnectindex].ps->gm&MODE_GAME) && ud.m_recstat != 1); + if ((g_player[myconnectindex].ps->gm&MODE_GAME)) closedemowrite(); else ud.m_recstat = !ud.m_recstat; } - if ((g_player[myconnectindex].ps.gm&MODE_GAME) && ud.m_recstat != 1) + if ((g_player[myconnectindex].ps->gm&MODE_GAME) && ud.m_recstat != 1) enabled = 0; - gametextpal(d,yy,ud.m_recstat?((ud.m_recstat && enabled && g_player[myconnectindex].ps.gm&MODE_GAME)?"Running":"On"):"Off",enabled?MENUHIGHLIGHT(io):DISABLEDMENUSHADE,enabled?0:1); + gametextpal(d,yy,ud.m_recstat?((ud.m_recstat && enabled && g_player[myconnectindex].ps->gm&MODE_GAME)?"Running":"On"):"Off",enabled?MENUHIGHLIGHT(io):DISABLEDMENUSHADE,enabled?0:1); break; case 10: if (x==io) cmenu(201); @@ -2878,7 +2878,7 @@ cheat_for_port_credits: switch (x) { case -1: - if (g_player[myconnectindex].ps.gm&MODE_GAME) cmenu(50); + if (g_player[myconnectindex].ps->gm&MODE_GAME) cmenu(50); else cmenu(0); break; @@ -3236,7 +3236,7 @@ cheat_for_port_credits: if (x==4) { ud.brightness = ss; - setbrightness(ud.brightness>>2,&g_player[myconnectindex].ps.palette[0],0); + setbrightness(ud.brightness>>2,&g_player[myconnectindex].ps->palette[0],0); } } @@ -4198,9 +4198,9 @@ cheat_for_port_credits: switch (x) { case -1: - if (g_player[myconnectindex].ps.gm&MODE_GAME && current_menu == 701) + if (g_player[myconnectindex].ps->gm&MODE_GAME && current_menu == 701) { - g_player[myconnectindex].ps.gm &= ~MODE_MENU; + g_player[myconnectindex].ps->gm &= ~MODE_MENU; if (ud.multimode < 2 && ud.recstat != 2) { ready2send = 1; @@ -4230,7 +4230,7 @@ cheat_for_port_credits: if (ud.config.MusicToggle == 0) MUSIC_Pause(); else { - if (ud.recstat != 2 && g_player[myconnectindex].ps.gm&MODE_GAME) + if (ud.recstat != 2 && g_player[myconnectindex].ps->gm&MODE_GAME) { if (map[(unsigned char)music_select].musicfn != NULL) playmusic(&map[(unsigned char)music_select].musicfn[0]); @@ -4354,7 +4354,7 @@ cheat_for_port_credits: if (x == -1) { // readsavenames(); - g_player[myconnectindex].ps.gm = MODE_GAME; + g_player[myconnectindex].ps->gm = MODE_GAME; if (ud.multimode < 2 && ud.recstat != 2) { ready2send = 1; @@ -4376,7 +4376,7 @@ cheat_for_port_credits: saveplayer(-1-(current_menu-360)); else saveplayer(current_menu-360); lastsavedpos = current_menu-360; - g_player[myconnectindex].ps.gm = MODE_GAME; + g_player[myconnectindex].ps->gm = MODE_GAME; if (ud.multimode < 2 && ud.recstat != 2) { @@ -4441,16 +4441,16 @@ cheat_for_port_credits: case -1: if (current_menu == 300) { - if ((g_player[myconnectindex].ps.gm&MODE_GAME) != MODE_GAME) + if ((g_player[myconnectindex].ps->gm&MODE_GAME) != MODE_GAME) { cmenu(0); break; } else - g_player[myconnectindex].ps.gm &= ~MODE_MENU; + g_player[myconnectindex].ps->gm &= ~MODE_MENU; } else - g_player[myconnectindex].ps.gm = MODE_GAME; + g_player[myconnectindex].ps->gm = MODE_GAME; if (ud.multimode < 2 && ud.recstat != 2) { @@ -4544,7 +4544,7 @@ DISPLAYNAMES: if (KB_KeyPressed(sc_Escape)) { - if (g_player[myconnectindex].ps.gm&MODE_GAME) + if (g_player[myconnectindex].ps->gm&MODE_GAME) cmenu(50); else cmenu(0); return; @@ -4604,7 +4604,7 @@ VOLUME_ALL_40x: if (x == -1) { - if (g_player[myconnectindex].ps.gm&MODE_GAME) + if (g_player[myconnectindex].ps->gm&MODE_GAME) cmenu(50); else cmenu(0); return; @@ -4642,8 +4642,8 @@ VOLUME_ALL_40x: { KB_ClearKeyDown(sc_N); quittimer = 0; - if (g_player[myconnectindex].ps.gm&MODE_DEMO && ud.recstat == 2) - g_player[myconnectindex].ps.gm = MODE_DEMO; + if (g_player[myconnectindex].ps->gm&MODE_DEMO && ud.recstat == 2) + g_player[myconnectindex].ps->gm = MODE_DEMO; else { if (current_menu == 502) @@ -4651,9 +4651,9 @@ VOLUME_ALL_40x: cmenu(last_menu); probey = last_menu_pos; } - else if (!(g_player[myconnectindex].ps.gm & MODE_GAME || ud.recstat == 2)) + else if (!(g_player[myconnectindex].ps->gm & MODE_GAME || ud.recstat == 2)) cmenu(0); - else g_player[myconnectindex].ps.gm &= ~MODE_MENU; + else g_player[myconnectindex].ps->gm &= ~MODE_MENU; if (ud.multimode < 2 && ud.recstat != 2) { ready2send = 1; @@ -4671,7 +4671,7 @@ VOLUME_ALL_40x: if (KB_KeyPressed(sc_Space) || KB_KeyPressed(sc_Enter) || KB_KeyPressed(sc_kpad_Enter) || KB_KeyPressed(sc_Y) || LMB) { KB_FlushKeyboardQueue(); - g_player[myconnectindex].ps.gm = MODE_DEMO; + g_player[myconnectindex].ps->gm = MODE_DEMO; if (ud.recstat == 1) closedemowrite(); cmenu(0); @@ -4681,7 +4681,7 @@ VOLUME_ALL_40x: if (x == -1 || KB_KeyPressed(sc_N) || RMB) { - g_player[myconnectindex].ps.gm &= ~MODE_MENU; + g_player[myconnectindex].ps->gm &= ~MODE_MENU; if (ud.multimode < 2 && ud.recstat != 2) { ready2send = 1; @@ -4724,14 +4724,17 @@ VOLUME_ALL_40x: x = probe(186,124,0,0); if (voting != myconnectindex) - g_player[myconnectindex].ps.gm &= ~MODE_MENU; + g_player[myconnectindex].ps->gm &= ~MODE_MENU; if (x == -1) { if (voting == myconnectindex) { - Bmemset(votes,0,sizeof(votes)); - Bmemset(gotvote,0,sizeof(gotvote)); + for (i=0;i (numplayers>>1)) || (!networkmode && myconnectindex == connecthead)) + if (j == numplayers || !g_player[myconnectindex].ps->i || (plrvotes > (numplayers>>1)) || (!networkmode && myconnectindex == connecthead)) { - if (plrvotes > (numplayers>>1) || !g_player[myconnectindex].ps.i || (!networkmode && myconnectindex == connecthead)) + if (plrvotes > (numplayers>>1) || !g_player[myconnectindex].ps->i || (!networkmode && myconnectindex == connecthead)) { if (ud.m_player_skill == 3) ud.m_respawn_monsters = 1; else ud.m_respawn_monsters = 0; @@ -4783,8 +4786,12 @@ VOLUME_ALL_40x: } else if (j == numplayers) { - Bmemset(votes,0,sizeof(votes)); - Bmemset(gotvote,0,sizeof(gotvote)); + for (i=0;igm &= ~MODE_MENU; } } else @@ -4811,7 +4818,7 @@ VOLUME_ALL_40x: } case 600: c = (320>>1) - 120; - if ((g_player[myconnectindex].ps.gm&MODE_GAME) != MODE_GAME) + if ((g_player[myconnectindex].ps->gm&MODE_GAME) != MODE_GAME) displayfragbar(); rotatesprite(160<<16,26<<16,65536L,0,MENUBAR,16,0,10,0,0,xdim-1,ydim-1); menutext(160,31,0,0,&g_player[myconnectindex].user_name[0]); @@ -4853,7 +4860,7 @@ VOLUME_ALL_40x: { case -1: ud.m_recstat = 0; - if (g_player[myconnectindex].ps.gm&MODE_GAME) cmenu(50); + if (g_player[myconnectindex].ps->gm&MODE_GAME) cmenu(50); else cmenu(0); break; case 0: @@ -4923,11 +4930,14 @@ VOLUME_ALL_40x: case 7: if (voting == -1) { - if (g_player[myconnectindex].ps.i) + if (g_player[myconnectindex].ps->i) { - Bmemset(votes,0,sizeof(votes)); - Bmemset(gotvote,0,sizeof(gotvote)); - votes[myconnectindex] = gotvote[myconnectindex] = 1; + for (i=0;igm&MODE_MENU) != MODE_MENU) { vscrn(); cameraclock = totalclock; diff --git a/polymer/eduke32/source/osdcmds.c b/polymer/eduke32/source/osdcmds.c index a4c00c4ad..50a552fc0 100644 --- a/polymer/eduke32/source/osdcmds.c +++ b/polymer/eduke32/source/osdcmds.c @@ -30,7 +30,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "crc32.h" #include -extern int gotvote[MAXPLAYERS], votes[MAXPLAYERS], voting; +extern int voting; struct osdcmd_cheatsinfo osdcmd_cheatsinfo_stat; static inline int osdcmd_quit(const osdfuncparm_t *parm) @@ -86,21 +86,10 @@ static int osdcmd_changelevel(const osdfuncparm_t *parm) } } - if (volume == 0) + if (level > MAXLEVELS || map[volume*MAXLEVELS+level].filename == NULL) { - if (level > 6) - { - OSD_Printf("changelevel: invalid volume 1 level number (range 1-7)\n"); - return OSDCMD_OK; - } - } - else - { - if (level > 10) - { - OSD_Printf("changelevel: invalid volume 2+ level number (range 1-11)\n"); - return OSDCMD_SHOWHELP; - } + OSD_Printf("changelevel: invalid level number\n"); + return OSDCMD_SHOWHELP; } if (numplayers > 1) @@ -112,13 +101,18 @@ static int osdcmd_changelevel(const osdfuncparm_t *parm) ud.m_volume_number = volume; ud.m_level_number = level; - if (g_player[myconnectindex].ps.i) + if (g_player[myconnectindex].ps->i) { int i; - Bmemset(votes,0,sizeof(votes)); - Bmemset(gotvote,0,sizeof(gotvote)); - votes[myconnectindex] = gotvote[myconnectindex] = 1; + for (i=0;igm |= MODE_MENU; cmenu(603); } return OSDCMD_OK; } - if (g_player[myconnectindex].ps.gm & MODE_GAME) + if (g_player[myconnectindex].ps->gm & MODE_GAME) { // in-game behave like a cheat osdcmd_cheatsinfo_stat.cheatnum = 2; @@ -214,13 +208,17 @@ static int osdcmd_map(const osdfuncparm_t *parm) ud.m_volume_number = 0; ud.m_level_number = 7; - if (g_player[myconnectindex].ps.i) + if (g_player[myconnectindex].ps->i) { int i; - Bmemset(votes,0,sizeof(votes)); - Bmemset(gotvote,0,sizeof(gotvote)); - votes[myconnectindex] = gotvote[myconnectindex] = 1; + for (i=0;igm |= MODE_MENU; cmenu(603); } return OSDCMD_OK; @@ -263,7 +261,7 @@ static int osdcmd_map(const osdfuncparm_t *parm) static int osdcmd_god(const osdfuncparm_t *parm) { - if (numplayers == 1 && g_player[myconnectindex].ps.gm & MODE_GAME) + if (numplayers == 1 && g_player[myconnectindex].ps->gm & MODE_GAME) { osdcmd_cheatsinfo_stat.cheatnum = 0; } @@ -277,7 +275,7 @@ static int osdcmd_god(const osdfuncparm_t *parm) static int osdcmd_noclip(const osdfuncparm_t *parm) { - if (numplayers == 1 && g_player[myconnectindex].ps.gm & MODE_GAME) + if (numplayers == 1 && g_player[myconnectindex].ps->gm & MODE_GAME) { osdcmd_cheatsinfo_stat.cheatnum = 20; } @@ -361,7 +359,7 @@ static int osdcmd_restartsound(const osdfuncparm_t *parm) if (ud.config.MusicToggle == 1) { - if (ud.recstat != 2 && g_player[myconnectindex].ps.gm&MODE_GAME) + if (ud.recstat != 2 && g_player[myconnectindex].ps->gm&MODE_GAME) { if (map[(unsigned char)music_select].musicfn != NULL) playmusic(&map[(unsigned char)music_select].musicfn[0]); @@ -445,7 +443,7 @@ static int osdcmd_spawn(const osdfuncparm_t *parm) short ang=0; short set=0, idx; - if (numplayers > 1 || !(g_player[myconnectindex].ps.gm & MODE_GAME)) + if (numplayers > 1 || !(g_player[myconnectindex].ps->gm & MODE_GAME)) { OSD_Printf("spawn: Can't spawn sprites in multiplayer games or demos\n"); return OSDCMD_OK; @@ -507,7 +505,7 @@ static int osdcmd_spawn(const osdfuncparm_t *parm) return OSDCMD_SHOWHELP; } - idx = spawn(g_player[myconnectindex].ps.i, (short)picnum); + idx = spawn(g_player[myconnectindex].ps->i, (short)picnum); if (set & 1) sprite[idx].pal = (char)pal; if (set & 2) sprite[idx].cstat = (short)cstat; if (set & 4) sprite[idx].ang = ang; @@ -542,7 +540,7 @@ static int osdcmd_setvar(const osdfuncparm_t *parm) for (i=0;ii, myconnectindex); return OSDCMD_OK; } @@ -757,7 +755,7 @@ static int osdcmd_gamma(const osdfuncparm_t *parm) return OSDCMD_SHOWHELP; } ud.brightness = atoi(parm->parms[0])<<2; - setbrightness(ud.brightness>>2,&g_player[screenpeek].ps.palette[0],0); + setbrightness(ud.brightness>>2,&g_player[screenpeek].ps->palette[0],0); OSD_Printf("gamma %d\n",ud.brightness>>2); return OSDCMD_OK; } @@ -766,9 +764,9 @@ static int osdcmd_give(const osdfuncparm_t *parm) { int i; - if (numplayers == 1 && g_player[myconnectindex].ps.gm & MODE_GAME) + if (numplayers == 1 && g_player[myconnectindex].ps->gm & MODE_GAME) { - if (g_player[myconnectindex].ps.dead_flag != 0) + if (g_player[myconnectindex].ps->dead_flag != 0) { OSD_Printf("give: Cannot give while dead.\n"); return OSDCMD_OK; @@ -783,7 +781,7 @@ static int osdcmd_give(const osdfuncparm_t *parm) } else if (!Bstrcasecmp(parm->parms[0], "health")) { - sprite[g_player[myconnectindex].ps.i].extra = 200; + sprite[g_player[myconnectindex].ps->i].extra = 200; return OSDCMD_OK; } else if (!Bstrcasecmp(parm->parms[0], "weapons")) @@ -795,13 +793,13 @@ static int osdcmd_give(const osdfuncparm_t *parm) { for (i=PISTOL_WEAPON;iparms[0], "armor")) { - g_player[myconnectindex].ps.shield_amount = 100; + g_player[myconnectindex].ps->shield_amount = 100; return OSDCMD_OK; } else if (!Bstrcasecmp(parm->parms[0], "keys")) @@ -829,20 +827,20 @@ void onvideomodechange(int newmode) if (newmode) { - if (g_player[screenpeek].ps.palette == palette || - g_player[screenpeek].ps.palette == waterpal || - g_player[screenpeek].ps.palette == titlepal || - g_player[screenpeek].ps.palette == animpal || - g_player[screenpeek].ps.palette == endingpal || - g_player[screenpeek].ps.palette == drealms || - g_player[screenpeek].ps.palette == slimepal) - pal = g_player[screenpeek].ps.palette; + if (g_player[screenpeek].ps->palette == palette || + g_player[screenpeek].ps->palette == waterpal || + g_player[screenpeek].ps->palette == titlepal || + g_player[screenpeek].ps->palette == animpal || + g_player[screenpeek].ps->palette == endingpal || + g_player[screenpeek].ps->palette == drealms || + g_player[screenpeek].ps->palette == slimepal) + pal = g_player[screenpeek].ps->palette; else pal = palette; } else { - pal = g_player[screenpeek].ps.palette; + pal = g_player[screenpeek].ps->palette; } setbrightness(ud.brightness>>2, pal, 0); diff --git a/polymer/eduke32/source/player.c b/polymer/eduke32/source/player.c index 2fda03a6e..f566f785a 100644 --- a/polymer/eduke32/source/player.c +++ b/polymer/eduke32/source/player.c @@ -129,9 +129,9 @@ static void tracers(long x1,long y1,long z1,long x2,long y2,long z2,long n) if (sect >= 0) { if (sector[sect].lotag == 2) - EGS(sect,x1,y1,z1,WATERBUBBLE,-32,4+(TRAND&3),4+(TRAND&3),TRAND&2047,0,0,g_player[0].ps.i,5); + EGS(sect,x1,y1,z1,WATERBUBBLE,-32,4+(TRAND&3),4+(TRAND&3),TRAND&2047,0,0,g_player[0].ps->i,5); else - EGS(sect,x1,y1,z1,SMALLSMOKE,-32,14,14,0,0,0,g_player[0].ps.i,5); + EGS(sect,x1,y1,z1,SMALLSMOKE,-32,14,14,0,0,0,g_player[0].ps->i,5); } } } @@ -167,7 +167,7 @@ static void hitscantrail(long x1, long y1, long z1, long x2, long y2, long z2, i updatesector(x1,y1,§); if (sect >= 0) { - j = EGS(sect,x1,y1,z1,projectile[atwith].trail,-32,projectile[atwith].txrepeat,projectile[atwith].tyrepeat,ang,0,0,g_player[0].ps.i,0); + j = EGS(sect,x1,y1,z1,projectile[atwith].trail,-32,projectile[atwith].txrepeat,projectile[atwith].tyrepeat,ang,0,0,g_player[0].ps->i,0); changespritestat(j,1); } else continue; @@ -201,9 +201,9 @@ static int aim(spritetype *s,int aang,int atwith) if (s->picnum == APLAYER) { - if (!g_player[s->yvel].ps.auto_aim) + if (!g_player[s->yvel].ps->auto_aim) return -1; - if (g_player[s->yvel].ps.auto_aim == 2) + if (g_player[s->yvel].ps->auto_aim == 2) { if (checkspriteflagsp(atwith,SPRITE_FLAG_PROJECTILE) && (projectile[atwith].workslike & PROJECTILE_FLAG_RPG)) return -1; @@ -228,8 +228,8 @@ static int aim(spritetype *s,int aang,int atwith) j = -1; - gotshrinker = (s->picnum == APLAYER && *aplWeaponWorksLike[g_player[s->yvel].ps.curr_weapon] == SHRINKER_WEAPON); - gotfreezer = (s->picnum == APLAYER && *aplWeaponWorksLike[g_player[s->yvel].ps.curr_weapon] == FREEZE_WEAPON); + gotshrinker = (s->picnum == APLAYER && *aplWeaponWorksLike[g_player[s->yvel].ps->curr_weapon] == SHRINKER_WEAPON); + gotfreezer = (s->picnum == APLAYER && *aplWeaponWorksLike[g_player[s->yvel].ps->curr_weapon] == FREEZE_WEAPON); smax = 0x7fffffff; @@ -253,7 +253,7 @@ static int aim(spritetype *s,int aang,int atwith) { if (PN == APLAYER && // ud.ffire == 0 && - (GTFLAGS(GAMETYPE_FLAG_PLAYERSFRIENDLY) || (GTFLAGS(GAMETYPE_FLAG_TDM) && g_player[sprite[i].yvel].ps.team == g_player[s->yvel].ps.team)) && + (GTFLAGS(GAMETYPE_FLAG_PLAYERSFRIENDLY) || (GTFLAGS(GAMETYPE_FLAG_TDM) && g_player[sprite[i].yvel].ps->team == g_player[s->yvel].ps->team)) && s->picnum == APLAYER && s != &sprite[i]) continue; @@ -281,7 +281,7 @@ static int aim(spritetype *s,int aang,int atwith) if (sdist > 512 && sdist < smax) { if (s->picnum == APLAYER) - a = (klabs(scale(SZ-s->z,10,sdist)-(g_player[s->yvel].ps.horiz+g_player[s->yvel].ps.horizoff-100)) < 100); + a = (klabs(scale(SZ-s->z,10,sdist)-(g_player[s->yvel].ps->horiz+g_player[s->yvel].ps->horizoff-100)) < 100); else a = 1; if (PN == ORGANTIC || PN == ROTATEGUN) @@ -313,12 +313,12 @@ int shoot(int i,int atwith) { p = s->yvel; - sx = g_player[p].ps.posx; - sy = g_player[p].ps.posy; - sz = g_player[p].ps.posz+g_player[p].ps.pyoff+(4<<8); - sa = g_player[p].ps.ang; + sx = g_player[p].ps->posx; + sy = g_player[p].ps->posy; + sz = g_player[p].ps->posz+g_player[p].ps->pyoff+(4<<8); + sa = g_player[p].ps->ang; - g_player[p].ps.crack_time = 777; + g_player[p].ps->crack_time = 777; } else { @@ -360,13 +360,13 @@ int shoot(int i,int atwith) { if (p >= 0) { - zvel = (100-g_player[p].ps.horiz-g_player[p].ps.horizoff)<<5; + zvel = (100-g_player[p].ps->horiz-g_player[p].ps->horizoff)<<5; sz += (6<<8); sa += 15; } else if (!(projectile[atwith].workslike & PROJECTILE_FLAG_NOAIM)) { - j = g_player[findplayer(s,&x)].ps.i; + j = g_player[findplayer(s,&x)].ps->i; zvel = ((sprite[j].z-sz)<<8) / (x+1); sa = getangle(sprite[j].x-sx,sprite[j].y-sy); } @@ -511,7 +511,7 @@ int shoot(int i,int atwith) if (projectile[atwith].sound > -1) spritesound(projectile[atwith].sound,j); } - if (p >= 0 && g_player[p].ps.steroids_amount > 0 && g_player[p].ps.steroids_amount < 400) + if (p >= 0 && g_player[p].ps->steroids_amount > 0 && g_player[p].ps->steroids_amount < 400) sprite[j].extra += (max_player_health>>2); if (hitspr >= 0 && sprite[hitspr].picnum != ACCESSSWITCH && sprite[hitspr].picnum != ACCESSSWITCH2) @@ -536,10 +536,10 @@ int shoot(int i,int atwith) } else if (p >= 0 && zvel > 0 && sector[hitsect].lotag == 1) { - j = spawn(g_player[p].ps.i,WATERSPLASH2); + j = spawn(g_player[p].ps->i,WATERSPLASH2); sprite[j].x = hitx; sprite[j].y = hity; - sprite[j].ang = g_player[p].ps.ang; // Total tweek + sprite[j].ang = g_player[p].ps->ang; // Total tweek sprite[j].xvel = 32; ssp(i,CLIPMASK0); sprite[j].xvel = 0; @@ -573,7 +573,7 @@ int shoot(int i,int atwith) dal -= (8<<8); return -1; } - zvel = ((sprite[j].z-sz-dal)<<8) / ldist(&sprite[g_player[p].ps.i], &sprite[j]) ; + zvel = ((sprite[j].z-sz-dal)<<8) / ldist(&sprite[g_player[p].ps->i], &sprite[j]) ; sa = getangle(sprite[j].x-sx,sprite[j].y-sy); } @@ -587,9 +587,9 @@ int shoot(int i,int atwith) if (projectile[atwith].workslike & PROJECTILE_FLAG_ACCURATE_AUTOAIM) { - if (!g_player[p].ps.auto_aim) + if (!g_player[p].ps->auto_aim) { - zvel = (100-g_player[p].ps.horiz-g_player[p].ps.horizoff)<<5; + zvel = (100-g_player[p].ps->horiz-g_player[p].ps->horizoff)<<5; if (hittype[i].temp_data[9]) zvel = hittype[i].temp_data[9]; hitscan(sx,sy,sz,sect,sintable[(sa+512)&2047],sintable[sa&2047], zvel<<6,&hitsect,&hitwall,&hitspr,&hitx,&hity,&hitz,CLIPMASK1); @@ -603,7 +603,7 @@ int shoot(int i,int atwith) if (j == -1) { sa += (angRange/2)-(TRAND&(angRange-1)); - zvel = (100-g_player[p].ps.horiz-g_player[p].ps.horizoff)<<5; + zvel = (100-g_player[p].ps->horiz-g_player[p].ps->horizoff)<<5; zvel += (zRange/2)-(TRAND&(zRange-1)); } } @@ -613,7 +613,7 @@ int shoot(int i,int atwith) if (j == -1) { // no target - zvel = (100-g_player[p].ps.horiz-g_player[p].ps.horizoff)<<5; + zvel = (100-g_player[p].ps->horiz-g_player[p].ps->horizoff)<<5; } zvel += (zRange/2)-(TRAND&(zRange-1)); } @@ -623,7 +623,7 @@ int shoot(int i,int atwith) { j = findplayer(s,&x); sz -= (4<<8); - zvel = ((g_player[j].ps.posz-sz) <<8) / (ldist(&sprite[g_player[j].ps.i], s)); + zvel = ((g_player[j].ps->posz-sz) <<8) / (ldist(&sprite[g_player[j].ps->i], s)); if (s->picnum != BOSS1) { zvel += 128-(TRAND&255); @@ -632,7 +632,7 @@ int shoot(int i,int atwith) else { zvel += 128-(TRAND&255); - sa = getangle(g_player[j].ps.posx-sx,g_player[j].ps.posy-sy)+64-(TRAND&127); + sa = getangle(g_player[j].ps->posx-sx,g_player[j].ps->posy-sy)+64-(TRAND&127); } } @@ -701,7 +701,7 @@ int shoot(int i,int atwith) if (hitspr >= 0) { checkhitsprite(hitspr,k); - if (sprite[hitspr].picnum == APLAYER && (ud.ffire == 1 || (!GTFLAGS(GAMETYPE_FLAG_PLAYERSFRIENDLY) && GTFLAGS(GAMETYPE_FLAG_TDM) && g_player[sprite[hitspr].yvel].ps.team != g_player[sprite[i].yvel].ps.team))) + if (sprite[hitspr].picnum == APLAYER && (ud.ffire == 1 || (!GTFLAGS(GAMETYPE_FLAG_PLAYERSFRIENDLY) && GTFLAGS(GAMETYPE_FLAG_TDM) && g_player[sprite[hitspr].yvel].ps->team != g_player[sprite[i].yvel].ps->team))) { l = spawn(k,JIBS6); sprite[k].xrepeat = sprite[k].yrepeat = 0; @@ -892,12 +892,12 @@ DOSKIPBULLETHOLE: if (j >= 0) { dal = ((sprite[j].xrepeat*tilesizy[sprite[j].picnum])<<1)+(8<<8); - zvel = ((sprite[j].z-sz-dal)*vel) / ldist(&sprite[g_player[p].ps.i], &sprite[j]); + zvel = ((sprite[j].z-sz-dal)*vel) / ldist(&sprite[g_player[p].ps->i], &sprite[j]); if (sprite[j].picnum != RECON) sa = getangle(sprite[j].x-sx,sprite[j].y-sy); } - // else zvel = (100-g_player[p].ps.horiz-g_player[p].ps.horizoff)*81; - else zvel = ((100-g_player[p].ps.horiz-g_player[p].ps.horizoff)*(projectile[atwith].vel/8)); + // else zvel = (100-g_player[p].ps->horiz-g_player[p].ps->horizoff)*81; + else zvel = ((100-g_player[p].ps->horiz-g_player[p].ps->horizoff)*(projectile[atwith].vel/8)); if (projectile[atwith].sound > -1) spritesound(projectile[atwith].sound,i); } else @@ -905,10 +905,10 @@ DOSKIPBULLETHOLE: if (!(projectile[atwith].workslike & PROJECTILE_FLAG_NOAIM)) { j = findplayer(s,&x); - sa = getangle(g_player[j].ps.oposx-sx,g_player[j].ps.oposy-sy); + sa = getangle(g_player[j].ps->oposx-sx,g_player[j].ps->oposy-sy); - l = ldist(&sprite[g_player[j].ps.i],s); - zvel = ((g_player[j].ps.oposz-sz)*vel) / l; + l = ldist(&sprite[g_player[j].ps->i],s); + zvel = ((g_player[j].ps->oposz-sz)*vel) / l; if (badguy(s) && (s->hitag&face_player_smart)) sa = s->ang+(TRAND&31)-16; @@ -992,13 +992,13 @@ DOSKIPBULLETHOLE: { if (p >= 0) { - zvel = (100-g_player[p].ps.horiz-g_player[p].ps.horizoff)<<5; + zvel = (100-g_player[p].ps->horiz-g_player[p].ps->horizoff)<<5; sz += (6<<8); sa += 15; } else { - j = g_player[findplayer(s,&x)].ps.i; + j = g_player[findplayer(s,&x)].ps->i; zvel = ((sprite[j].z-sz)<<8) / (x+1); sa = getangle(sprite[j].x-sx,sprite[j].y-sy); } @@ -1075,7 +1075,7 @@ DOSKIPBULLETHOLE: hittype[k].temp_data[8] = hitspr; } - if (p >= 0 && g_player[p].ps.steroids_amount > 0 && g_player[p].ps.steroids_amount < 400) + if (p >= 0 && g_player[p].ps->steroids_amount > 0 && g_player[p].ps->steroids_amount < 400) sprite[j].extra += (max_player_health>>2); if (hitspr >= 0 && sprite[hitspr].picnum != ACCESSSWITCH && sprite[hitspr].picnum != ACCESSSWITCH2) @@ -1100,10 +1100,10 @@ DOSKIPBULLETHOLE: } else if (p >= 0 && zvel > 0 && sector[hitsect].lotag == 1) { - j = spawn(g_player[p].ps.i,WATERSPLASH2); + j = spawn(g_player[p].ps->i,WATERSPLASH2); sprite[j].x = hitx; sprite[j].y = hity; - sprite[j].ang = g_player[p].ps.ang; // Total tweek + sprite[j].ang = g_player[p].ps->ang; // Total tweek sprite[j].xvel = 32; ssp(i,CLIPMASK0); sprite[j].xvel = 0; @@ -1140,7 +1140,7 @@ DOSKIPBULLETHOLE: dal -= (8<<8); } - zvel = ((sprite[j].z-sz-dal)<<8) / ldist(&sprite[g_player[p].ps.i], &sprite[j]) ; + zvel = ((sprite[j].z-sz-dal)<<8) / ldist(&sprite[g_player[p].ps->i], &sprite[j]) ; sa = getangle(sprite[j].x-sx,sprite[j].y-sy); } @@ -1157,9 +1157,9 @@ DOSKIPBULLETHOLE: if (atwith == SHOTSPARK1__STATIC && !WW2GI && !NAM) { - if (!g_player[p].ps.auto_aim) + if (!g_player[p].ps->auto_aim) { - zvel = (100-g_player[p].ps.horiz-g_player[p].ps.horizoff)<<5; + zvel = (100-g_player[p].ps->horiz-g_player[p].ps->horizoff)<<5; if (hittype[i].temp_data[9]) zvel = hittype[i].temp_data[9]; hitscan(sx,sy,sz,sect,sintable[(sa+512)&2047],sintable[sa&2047], zvel<<6,&hitsect,&hitwall,&hitspr,&hitx,&hity,&hitz,CLIPMASK1); @@ -1173,7 +1173,7 @@ DOSKIPBULLETHOLE: if (j == -1) { sa += (angRange/2)-(TRAND&(angRange-1)); - zvel = (100-g_player[p].ps.horiz-g_player[p].ps.horizoff)<<5; + zvel = (100-g_player[p].ps->horiz-g_player[p].ps->horizoff)<<5; zvel += (zRange/2)-(TRAND&(zRange-1)); } } @@ -1183,7 +1183,7 @@ DOSKIPBULLETHOLE: if (j == -1) { // no target - zvel = (100-g_player[p].ps.horiz-g_player[p].ps.horizoff)<<5; + zvel = (100-g_player[p].ps->horiz-g_player[p].ps->horizoff)<<5; } zvel += (zRange/2)-(TRAND&(zRange-1)); } @@ -1194,7 +1194,7 @@ DOSKIPBULLETHOLE: { j = findplayer(s,&x); sz -= (4<<8); - zvel = ((g_player[j].ps.posz-sz) <<8) / (ldist(&sprite[g_player[j].ps.i], s)); + zvel = ((g_player[j].ps->posz-sz) <<8) / (ldist(&sprite[g_player[j].ps->i], s)); if (s->picnum != BOSS1) { zvel += 128-(TRAND&255); @@ -1203,7 +1203,7 @@ DOSKIPBULLETHOLE: else { zvel += 128-(TRAND&255); - sa = getangle(g_player[j].ps.posx-sx,g_player[j].ps.posy-sy)+64-(TRAND&127); + sa = getangle(g_player[j].ps->posx-sx,g_player[j].ps->posy-sy)+64-(TRAND&127); } } @@ -1253,7 +1253,7 @@ DOSKIPBULLETHOLE: if (hitspr >= 0) { checkhitsprite(hitspr,k); - if (sprite[hitspr].picnum == APLAYER && (ud.ffire == 1 || (!GTFLAGS(GAMETYPE_FLAG_PLAYERSFRIENDLY) && GTFLAGS(GAMETYPE_FLAG_TDM) && g_player[sprite[hitspr].yvel].ps.team != g_player[sprite[i].yvel].ps.team))) + if (sprite[hitspr].picnum == APLAYER && (ud.ffire == 1 || (!GTFLAGS(GAMETYPE_FLAG_PLAYERSFRIENDLY) && GTFLAGS(GAMETYPE_FLAG_TDM) && g_player[sprite[hitspr].yvel].ps->team != g_player[sprite[i].yvel].ps->team))) { l = spawn(k,JIBS6); sprite[k].xrepeat = sprite[k].yrepeat = 0; @@ -1426,18 +1426,18 @@ SKIPBULLETHOLE: if (j >= 0) { dal = ((sprite[j].xrepeat*tilesizy[sprite[j].picnum])<<1)-(12<<8); - zvel = ((sprite[j].z-sz-dal)*vel) / ldist(&sprite[g_player[p].ps.i], &sprite[j]) ; + zvel = ((sprite[j].z-sz-dal)*vel) / ldist(&sprite[g_player[p].ps->i], &sprite[j]) ; sa = getangle(sprite[j].x-sx,sprite[j].y-sy); } else - zvel = (100-g_player[p].ps.horiz-g_player[p].ps.horizoff)*98; + zvel = (100-g_player[p].ps->horiz-g_player[p].ps->horizoff)*98; } else { j = findplayer(s,&x); - // sa = getangle(g_player[j].ps.oposx-sx,g_player[j].ps.oposy-sy); + // sa = getangle(g_player[j].ps->oposx-sx,g_player[j].ps->oposy-sy); sa += 16-(TRAND&31); - zvel = (((g_player[j].ps.oposz - sz + (3<<8)))*vel) / ldist(&sprite[g_player[j].ps.i],s); + zvel = (((g_player[j].ps->oposz - sz + (3<<8)))*vel) / ldist(&sprite[g_player[j].ps->i],s); } if (hittype[i].temp_data[9]) zvel = hittype[i].temp_data[9]; oldzvel = zvel; @@ -1526,18 +1526,18 @@ SKIPBULLETHOLE: if (j >= 0) { dal = ((sprite[j].xrepeat*tilesizy[sprite[j].picnum])<<1)+(8<<8); - zvel = ((sprite[j].z-sz-dal)*vel) / ldist(&sprite[g_player[p].ps.i], &sprite[j]); + zvel = ((sprite[j].z-sz-dal)*vel) / ldist(&sprite[g_player[p].ps->i], &sprite[j]); if (sprite[j].picnum != RECON) sa = getangle(sprite[j].x-sx,sprite[j].y-sy); } - else zvel = (100-g_player[p].ps.horiz-g_player[p].ps.horizoff)*81; + else zvel = (100-g_player[p].ps->horiz-g_player[p].ps->horizoff)*81; if (atwith == RPG) spritesound(RPG_SHOOT,i); } else { j = findplayer(s,&x); - sa = getangle(g_player[j].ps.oposx-sx,g_player[j].ps.oposy-sy); + sa = getangle(g_player[j].ps->oposx-sx,g_player[j].ps->oposy-sy); if (PN == BOSS3) sz -= (32<<8); else if (PN == BOSS2) @@ -1546,8 +1546,8 @@ SKIPBULLETHOLE: sz += 24<<8; } - l = ldist(&sprite[g_player[j].ps.i],s); - zvel = ((g_player[j].ps.oposz-sz)*vel) / l; + l = ldist(&sprite[g_player[j].ps->i],s); + zvel = ((g_player[j].ps->oposz-sz)*vel) / l; if (badguy(s) && (s->hitag&face_player_smart)) sa = s->ang+(TRAND&31)-16; @@ -1608,13 +1608,13 @@ SKIPBULLETHOLE: } } - else if (*aplWeaponWorksLike[g_player[p].ps.curr_weapon] == DEVISTATOR_WEAPON) + else if (*aplWeaponWorksLike[g_player[p].ps->curr_weapon] == DEVISTATOR_WEAPON) { sprite[j].extra >>= 2; sprite[j].ang += 16-(TRAND&31); sprite[j].zvel += 256-(TRAND&511); - if (g_player[p].ps.hbomb_hold_delay) + if (g_player[p].ps->hbomb_hold_delay) { sprite[j].x -= sintable[sa&2047]/644; sprite[j].y -= sintable[(sa+1024+512)&2047]/644; @@ -1639,10 +1639,10 @@ SKIPBULLETHOLE: case HANDHOLDINGLASER__STATIC: if (p >= 0) - zvel = (100-g_player[p].ps.horiz-g_player[p].ps.horizoff)*32; + zvel = (100-g_player[p].ps->horiz-g_player[p].ps->horizoff)*32; else zvel = 0; if (hittype[i].temp_data[9]) zvel = hittype[i].temp_data[9]; - hitscan(sx,sy,sz-g_player[p].ps.pyoff,sect, + hitscan(sx,sy,sz-g_player[p].ps->pyoff,sect, sintable[(sa+512)&2047], sintable[sa&2047], zvel<<6,&hitsect,&hitwall,&hitspr,&hitx,&hity,&hitz,CLIPMASK1); @@ -1664,12 +1664,12 @@ SKIPBULLETHOLE: if (j == 1) { - long lTripBombControl=GetGameVar("TRIPBOMB_CONTROL", TRIPBOMB_TRIPWIRE, g_player[p].ps.i, p); + long lTripBombControl=GetGameVar("TRIPBOMB_CONTROL", TRIPBOMB_TRIPWIRE, g_player[p].ps->i, p); k = EGS(hitsect,hitx,hity,hitz,TRIPBOMB,-16,4,5,sa,0,0,i,6); if (lTripBombControl & TRIPBOMB_TIMER) { - long lLifetime=GetGameVar("STICKYBOMB_LIFETIME", NAM_GRENADE_LIFETIME, g_player[p].ps.i, p); - long lLifetimeVar=GetGameVar("STICKYBOMB_LIFETIME_VAR", NAM_GRENADE_LIFETIME_VAR, g_player[p].ps.i, p); + long lLifetime=GetGameVar("STICKYBOMB_LIFETIME", NAM_GRENADE_LIFETIME, g_player[p].ps->i, p); + long lLifetimeVar=GetGameVar("STICKYBOMB_LIFETIME_VAR", NAM_GRENADE_LIFETIME_VAR, g_player[p].ps->i, p); // set timer. blows up when at zero.... hittype[k].temp_data[7]=lLifetime + mulscale(krand(),lLifetimeVar, 14) @@ -1694,7 +1694,7 @@ SKIPBULLETHOLE: if (s->extra >= 0) s->shade = -96; - j = g_player[findplayer(s,&x)].ps.i; + j = g_player[findplayer(s,&x)].ps->i; x = ldist(&sprite[j],s); zvel = -x>>1; @@ -1730,13 +1730,13 @@ SKIPBULLETHOLE: dal -= (8<<8); } - zvel = ((sprite[j].z-sz-dal)<<8) / (ldist(&sprite[g_player[p].ps.i], &sprite[j])); + zvel = ((sprite[j].z-sz-dal)<<8) / (ldist(&sprite[g_player[p].ps->i], &sprite[j])); sa = getangle(sprite[j].x-sx,sprite[j].y-sy); } else { sa += 16-(TRAND&31); - zvel = (100-g_player[p].ps.horiz-g_player[p].ps.horizoff)<<5; + zvel = (100-g_player[p].ps->horiz-g_player[p].ps->horizoff)<<5; zvel += 128-(TRAND&255); } @@ -1746,7 +1746,7 @@ SKIPBULLETHOLE: { j = findplayer(s,&x); sz -= (4<<8); - zvel = ((g_player[j].ps.posz-sz) <<8) / (ldist(&sprite[g_player[j].ps.i], s)); + zvel = ((g_player[j].ps->posz-sz) <<8) / (ldist(&sprite[g_player[j].ps->i], s)); zvel += 128-(TRAND&255); sa += 32-(TRAND&63); } @@ -1817,16 +1817,16 @@ SKIPBULLETHOLE: if (j >= 0) { dal = ((sprite[j].xrepeat*tilesizy[sprite[j].picnum])<<1); - zvel = ((sprite[j].z-sz-dal-(4<<8))*768) / (ldist(&sprite[g_player[p].ps.i], &sprite[j])); + zvel = ((sprite[j].z-sz-dal-(4<<8))*768) / (ldist(&sprite[g_player[p].ps->i], &sprite[j])); sa = getangle(sprite[j].x-sx,sprite[j].y-sy); } - else zvel = (100-g_player[p].ps.horiz-g_player[p].ps.horizoff)*98; + else zvel = (100-g_player[p].ps->horiz-g_player[p].ps->horizoff)*98; } else if (s->statnum != 3) { j = findplayer(s,&x); - l = ldist(&sprite[g_player[j].ps.i],s); - zvel = ((g_player[j].ps.oposz-sz)*512) / l ; + l = ldist(&sprite[g_player[j].ps->i],s); + zvel = ((g_player[j].ps->oposz-sz)*512) / l ; } else zvel = 0; if (hittype[i].temp_data[9]) zvel = hittype[i].temp_data[9]; @@ -1849,17 +1849,17 @@ static void displayloogie(int snum) { long i, a, x, y, z; - if (g_player[snum].ps.loogcnt == 0) return; + if (g_player[snum].ps->loogcnt == 0) return; - y = (g_player[snum].ps.loogcnt<<2); - for (i=0;iloogcnt<<2); + for (i=0;inumloogs;i++) { - a = klabs(sintable[((g_player[snum].ps.loogcnt+i)<<5)&2047])>>5; - z = 4096+((g_player[snum].ps.loogcnt+i)<<9); - x = (-g_player[snum].sync.avel)+(sintable[((g_player[snum].ps.loogcnt+i)<<6)&2047]>>10); + a = klabs(sintable[((g_player[snum].ps->loogcnt+i)<<5)&2047])>>5; + z = 4096+((g_player[snum].ps->loogcnt+i)<<9); + x = (-g_player[snum].sync->avel)+(sintable[((g_player[snum].ps->loogcnt+i)<<6)&2047]>>10); rotatesprite( - (g_player[snum].ps.loogiex[i]+x)<<16,(200+g_player[snum].ps.loogiey[i]-y)<<16,z-(i<<8),256-a, + (g_player[snum].ps->loogiex[i]+x)<<16,(200+g_player[snum].ps->loogiey[i]-y)<<16,z-(i<<8),256-a, LOOGIE,0,0,2,0,0,xdim-1,ydim-1); } } @@ -1869,11 +1869,11 @@ static int animatefist(int gs,int snum) int looking_arc,fisti,fistpal; long fistzoom, fistz; - fisti = g_player[snum].ps.fist_incs; + fisti = g_player[snum].ps->fist_incs; if (fisti > 32) fisti = 32; if (fisti <= 0) return 0; - looking_arc = klabs(g_player[snum].ps.look_ang)/9; + looking_arc = klabs(g_player[snum].ps->look_ang)/9; fistzoom = 65536L - (sintable[(512+(fisti<<6))&2047]<<2); if (fistzoom > 90612L) @@ -1882,13 +1882,13 @@ static int animatefist(int gs,int snum) fistzoom = 40290; fistz = 194 + (sintable[((6+fisti)<<7)&2047]>>9); - if (sprite[g_player[snum].ps.i].pal == 1) + if (sprite[g_player[snum].ps->i].pal == 1) fistpal = 1; else - fistpal = sector[g_player[snum].ps.cursectnum].floorpal; + fistpal = sector[g_player[snum].ps->cursectnum].floorpal; rotatesprite( - (-fisti+222+(g_player[snum].sync.avel>>4))<<16, + (-fisti+222+(g_player[snum].sync->avel>>4))<<16, (looking_arc+fistz)<<16, fistzoom,0,FIST,gs,fistpal,2,0,0,xdim-1,ydim-1); @@ -1900,22 +1900,22 @@ static int animateknee(int gs,int snum) short knee_y[] = {0,-8,-16,-32,-64,-84,-108,-108,-108,-72,-32,-8}; int looking_arc, pal; - if (g_player[snum].ps.knee_incs > 11 || g_player[snum].ps.knee_incs == 0 || sprite[g_player[snum].ps.i].extra <= 0) return 0; + if (g_player[snum].ps->knee_incs > 11 || g_player[snum].ps->knee_incs == 0 || sprite[g_player[snum].ps->i].extra <= 0) return 0; - looking_arc = knee_y[g_player[snum].ps.knee_incs] + klabs(g_player[snum].ps.look_ang)/9; + looking_arc = knee_y[g_player[snum].ps->knee_incs] + klabs(g_player[snum].ps->look_ang)/9; - looking_arc -= (g_player[snum].ps.hard_landing<<3); + looking_arc -= (g_player[snum].ps->hard_landing<<3); - if (sprite[g_player[snum].ps.i].pal == 1) + if (sprite[g_player[snum].ps->i].pal == 1) pal = 1; else { - pal = sector[g_player[snum].ps.cursectnum].floorpal; + pal = sector[g_player[snum].ps->cursectnum].floorpal; if (pal == 0) - pal = g_player[snum].ps.palookup; + pal = g_player[snum].ps->palookup; } - myospal(105+(g_player[snum].sync.avel>>4)-(g_player[snum].ps.look_ang>>1)+(knee_y[g_player[snum].ps.knee_incs]>>2),looking_arc+280-((g_player[snum].ps.horiz-g_player[snum].ps.horizoff)>>4),KNEE,gs,4,pal); + myospal(105+(g_player[snum].sync->avel>>4)-(g_player[snum].ps->look_ang>>1)+(knee_y[g_player[snum].ps->knee_incs]>>2),looking_arc+280-((g_player[snum].ps->horiz-g_player[snum].ps->horizoff)>>4),KNEE,gs,4,pal); return 1; } @@ -1925,18 +1925,18 @@ static int animateknuckles(int gs,int snum) short knuckle_frames[] = {0,1,2,2,3,3,3,2,2,1,0}; int looking_arc, pal; - if (g_player[snum].ps.knuckle_incs == 0 || sprite[g_player[snum].ps.i].extra <= 0) return 0; + if (g_player[snum].ps->knuckle_incs == 0 || sprite[g_player[snum].ps->i].extra <= 0) return 0; - looking_arc = klabs(g_player[snum].ps.look_ang)/9; + looking_arc = klabs(g_player[snum].ps->look_ang)/9; - looking_arc -= (g_player[snum].ps.hard_landing<<3); + looking_arc -= (g_player[snum].ps->hard_landing<<3); - if (sprite[g_player[snum].ps.i].pal == 1) + if (sprite[g_player[snum].ps->i].pal == 1) pal = 1; else - pal = sector[g_player[snum].ps.cursectnum].floorpal; + pal = sector[g_player[snum].ps->cursectnum].floorpal; - myospal(160+(g_player[snum].sync.avel>>4)-(g_player[snum].ps.look_ang>>1),looking_arc+180-((g_player[snum].ps.horiz-g_player[snum].ps.horizoff)>>4),CRACKKNUCKLES+knuckle_frames[g_player[snum].ps.knuckle_incs>>1],gs,4,pal); + myospal(160+(g_player[snum].sync->avel>>4)-(g_player[snum].ps->look_ang>>1),looking_arc+180-((g_player[snum].ps->horiz-g_player[snum].ps->horizoff)>>4),CRACKKNUCKLES+knuckle_frames[g_player[snum].ps->knuckle_incs>>1],gs,4,pal); return 1; } @@ -2022,12 +2022,12 @@ void displaymasks(int snum) { int p; - if (sprite[g_player[snum].ps.i].pal == 1) + if (sprite[g_player[snum].ps->i].pal == 1) p = 1; else - p = sector[g_player[snum].ps.cursectnum].floorpal; + p = sector[g_player[snum].ps->cursectnum].floorpal; - if (g_player[snum].ps.scuba_on) + if (g_player[snum].ps->scuba_on) { rotatesprite(43<<16,(200-tilesizy[SCUBAMASK])<<16,65536,0,SCUBAMASK,0,p,2+16,windowx1,windowy1,windowx2,windowy2); rotatesprite((320-43)<<16,(200-tilesizy[SCUBAMASK])<<16,65536,1024,SCUBAMASK,0,p,2+4+16,windowx1,windowy1,windowx2,windowy2); @@ -2039,23 +2039,23 @@ static int animatetip(int gs,int snum) int p,looking_arc; short tip_y[] = {0,-8,-16,-32,-64,-84,-108,-108,-108,-108,-108,-108,-108,-108,-108,-108,-96,-72,-64,-32,-16}; - if (g_player[snum].ps.tipincs == 0) return 0; + if (g_player[snum].ps->tipincs == 0) return 0; - looking_arc = klabs(g_player[snum].ps.look_ang)/9; - looking_arc -= (g_player[snum].ps.hard_landing<<3); + looking_arc = klabs(g_player[snum].ps->look_ang)/9; + looking_arc -= (g_player[snum].ps->hard_landing<<3); - if (sprite[g_player[snum].ps.i].pal == 1) + if (sprite[g_player[snum].ps->i].pal == 1) p = 1; else - p = sector[g_player[snum].ps.cursectnum].floorpal; + p = sector[g_player[snum].ps->cursectnum].floorpal; - /* if(g_player[snum].ps.access_spritenum >= 0) - p = sprite[g_player[snum].ps.access_spritenum].pal; + /* if(g_player[snum].ps->access_spritenum >= 0) + p = sprite[g_player[snum].ps->access_spritenum].pal; else - p = wall[g_player[snum].ps.access_wallnum].pal; + p = wall[g_player[snum].ps->access_wallnum].pal; */ - myospal(170+(g_player[snum].sync.avel>>4)-(g_player[snum].ps.look_ang>>1), - (tip_y[g_player[snum].ps.tipincs]>>1)+looking_arc+240-((g_player[snum].ps.horiz-g_player[snum].ps.horizoff)>>4),TIP+((26-g_player[snum].ps.tipincs)>>4),gs,0,p); + myospal(170+(g_player[snum].sync->avel>>4)-(g_player[snum].ps->look_ang>>1), + (tip_y[g_player[snum].ps->tipincs]>>1)+looking_arc+240-((g_player[snum].ps->horiz-g_player[snum].ps->horizoff)>>4),TIP+((26-g_player[snum].ps->tipincs)>>4),gs,0,p); return 1; } @@ -2066,21 +2066,21 @@ static int animateaccess(int gs,int snum) int looking_arc; int p; - if (g_player[snum].ps.access_incs == 0 || sprite[g_player[snum].ps.i].extra <= 0) return 0; + if (g_player[snum].ps->access_incs == 0 || sprite[g_player[snum].ps->i].extra <= 0) return 0; - looking_arc = access_y[g_player[snum].ps.access_incs] + klabs(g_player[snum].ps.look_ang)/9; - looking_arc -= (g_player[snum].ps.hard_landing<<3); + looking_arc = access_y[g_player[snum].ps->access_incs] + klabs(g_player[snum].ps->look_ang)/9; + looking_arc -= (g_player[snum].ps->hard_landing<<3); - if (g_player[snum].ps.access_spritenum >= 0) - p = sprite[g_player[snum].ps.access_spritenum].pal; + if (g_player[snum].ps->access_spritenum >= 0) + p = sprite[g_player[snum].ps->access_spritenum].pal; else p = 0; // else - // p = wall[g_player[snum].ps.access_wallnum].pal; + // p = wall[g_player[snum].ps->access_wallnum].pal; - if ((g_player[snum].ps.access_incs-3) > 0 && (g_player[snum].ps.access_incs-3)>>3) - myospal(170+(g_player[snum].sync.avel>>4)-(g_player[snum].ps.look_ang>>1)+(access_y[g_player[snum].ps.access_incs]>>2),looking_arc+266-((g_player[snum].ps.horiz-g_player[snum].ps.horizoff)>>4),HANDHOLDINGLASER+(g_player[snum].ps.access_incs>>3),gs,0,p); + if ((g_player[snum].ps->access_incs-3) > 0 && (g_player[snum].ps->access_incs-3)>>3) + myospal(170+(g_player[snum].sync->avel>>4)-(g_player[snum].ps->look_ang>>1)+(access_y[g_player[snum].ps->access_incs]>>2),looking_arc+266-((g_player[snum].ps->horiz-g_player[snum].ps->horizoff)>>4),HANDHOLDINGLASER+(g_player[snum].ps->access_incs>>3),gs,0,p); else - myospal(170+(g_player[snum].sync.avel>>4)-(g_player[snum].ps.look_ang>>1)+(access_y[g_player[snum].ps.access_incs]>>2),looking_arc+266-((g_player[snum].ps.horiz-g_player[snum].ps.horizoff)>>4),HANDHOLDINGACCESS,gs,4,p); + myospal(170+(g_player[snum].sync->avel>>4)-(g_player[snum].ps->look_ang>>1)+(access_y[g_player[snum].ps->access_incs]>>2),looking_arc+266-((g_player[snum].ps->horiz-g_player[snum].ps->horizoff)>>4),HANDHOLDINGACCESS,gs,4,p); return 1; } @@ -2106,7 +2106,7 @@ static void myospalw(long x, long y, int tilenum, int shade, int orientation, in case HANDREMOTE_WEAPON: case HANDBOMB_WEAPON: case SHOTGUN_WEAPON: - rotatesprite(160<<16,(180+(g_player[screenpeek].ps.weapon_pos*g_player[screenpeek].ps.weapon_pos))<<16,scale(65536,ud.statusbarscale,100),0,g_currentweapon==GROW_WEAPON?GROWSPRITEICON:weapon_sprites[g_currentweapon],0,0,2,windowx1,windowy1,windowx2,windowy2); + rotatesprite(160<<16,(180+(g_player[screenpeek].ps->weapon_pos*g_player[screenpeek].ps->weapon_pos))<<16,scale(65536,ud.statusbarscale,100),0,g_currentweapon==GROW_WEAPON?GROWSPRITEICON:weapon_sprites[g_currentweapon],0,0,2,windowx1,windowy1,windowx2,windowy2); break; } } @@ -2119,7 +2119,7 @@ void displayweapon(int snum) long gun_pos, looking_arc, cw; long weapon_xoffset, i, j; int o = 0,pal; - player_struct *p = &g_player[snum].ps; + player_struct *p = g_player[snum].ps; short *kb = &p->kickback_pic; int gs; @@ -2213,9 +2213,9 @@ void displayweapon(int snum) case KNEE_WEAPON: - SetGameVarID(g_iReturnVarID,0,g_player[screenpeek].ps.i,screenpeek); - OnEvent(EVENT_DRAWWEAPON,g_player[screenpeek].ps.i,screenpeek, -1); - if (GetGameVarID(g_iReturnVarID,g_player[screenpeek].ps.i,screenpeek) == 0) + SetGameVarID(g_iReturnVarID,0,g_player[screenpeek].ps->i,screenpeek); + OnEvent(EVENT_DRAWWEAPON,g_player[screenpeek].ps->i,screenpeek, -1); + if (GetGameVarID(g_iReturnVarID,g_player[screenpeek].ps->i,screenpeek) == 0) { if ((*kb) > 0) { @@ -2240,9 +2240,9 @@ void displayweapon(int snum) case TRIPBOMB_WEAPON: - SetGameVarID(g_iReturnVarID,0,g_player[screenpeek].ps.i,screenpeek); - OnEvent(EVENT_DRAWWEAPON,g_player[screenpeek].ps.i,screenpeek, -1); - if (GetGameVarID(g_iReturnVarID,g_player[screenpeek].ps.i,screenpeek) == 0) + SetGameVarID(g_iReturnVarID,0,g_player[screenpeek].ps->i,screenpeek); + OnEvent(EVENT_DRAWWEAPON,g_player[screenpeek].ps->i,screenpeek, -1); + if (GetGameVarID(g_iReturnVarID,g_player[screenpeek].ps->i,screenpeek) == 0) { if (sprite[p->i].pal == 1) pal = 1; @@ -2269,9 +2269,9 @@ void displayweapon(int snum) case RPG_WEAPON: - SetGameVarID(g_iReturnVarID,0,g_player[screenpeek].ps.i,screenpeek); - OnEvent(EVENT_DRAWWEAPON,g_player[screenpeek].ps.i,screenpeek, -1); - if (GetGameVarID(g_iReturnVarID,g_player[screenpeek].ps.i,screenpeek) == 0) + SetGameVarID(g_iReturnVarID,0,g_player[screenpeek].ps->i,screenpeek); + OnEvent(EVENT_DRAWWEAPON,g_player[screenpeek].ps->i,screenpeek, -1); + if (GetGameVarID(g_iReturnVarID,g_player[screenpeek].ps->i,screenpeek) == 0) { if (sprite[p->i].pal == 1) pal = 1; @@ -2296,9 +2296,9 @@ void displayweapon(int snum) case SHOTGUN_WEAPON: - SetGameVarID(g_iReturnVarID,0,g_player[screenpeek].ps.i,screenpeek); - OnEvent(EVENT_DRAWWEAPON,g_player[screenpeek].ps.i,screenpeek, -1); - if (GetGameVarID(g_iReturnVarID,g_player[screenpeek].ps.i,screenpeek) == 0) + SetGameVarID(g_iReturnVarID,0,g_player[screenpeek].ps->i,screenpeek); + OnEvent(EVENT_DRAWWEAPON,g_player[screenpeek].ps->i,screenpeek, -1); + if (GetGameVarID(g_iReturnVarID,g_player[screenpeek].ps->i,screenpeek) == 0) { if (sprite[p->i].pal == 1) pal = 1; @@ -2381,9 +2381,9 @@ void displayweapon(int snum) case CHAINGUN_WEAPON: - SetGameVarID(g_iReturnVarID,0,g_player[screenpeek].ps.i,screenpeek); - OnEvent(EVENT_DRAWWEAPON,g_player[screenpeek].ps.i,screenpeek, -1); - if (GetGameVarID(g_iReturnVarID,g_player[screenpeek].ps.i,screenpeek) == 0) + SetGameVarID(g_iReturnVarID,0,g_player[screenpeek].ps->i,screenpeek); + OnEvent(EVENT_DRAWWEAPON,g_player[screenpeek].ps->i,screenpeek, -1); + if (GetGameVarID(g_iReturnVarID,g_player[screenpeek].ps->i,screenpeek) == 0) { if (sprite[p->i].pal == 1) pal = 1; @@ -2431,9 +2431,9 @@ void displayweapon(int snum) case PISTOL_WEAPON: - SetGameVarID(g_iReturnVarID,0,g_player[screenpeek].ps.i,screenpeek); - OnEvent(EVENT_DRAWWEAPON,g_player[screenpeek].ps.i,screenpeek, -1); - if (GetGameVarID(g_iReturnVarID,g_player[screenpeek].ps.i,screenpeek) == 0) + SetGameVarID(g_iReturnVarID,0,g_player[screenpeek].ps->i,screenpeek); + OnEvent(EVENT_DRAWWEAPON,g_player[screenpeek].ps->i,screenpeek, -1); + if (GetGameVarID(g_iReturnVarID,g_player[screenpeek].ps->i,screenpeek) == 0) { if (sprite[p->i].pal == 1) pal = 1; @@ -2486,9 +2486,9 @@ void displayweapon(int snum) break; case HANDBOMB_WEAPON: { - SetGameVarID(g_iReturnVarID,0,g_player[screenpeek].ps.i,screenpeek); - OnEvent(EVENT_DRAWWEAPON,g_player[screenpeek].ps.i,screenpeek, -1); - if (GetGameVarID(g_iReturnVarID,g_player[screenpeek].ps.i,screenpeek) == 0) + SetGameVarID(g_iReturnVarID,0,g_player[screenpeek].ps->i,screenpeek); + OnEvent(EVENT_DRAWWEAPON,g_player[screenpeek].ps->i,screenpeek, -1); + if (GetGameVarID(g_iReturnVarID,g_player[screenpeek].ps->i,screenpeek) == 0) { if (sprite[p->i].pal == 1) pal = 1; @@ -2521,9 +2521,9 @@ void displayweapon(int snum) case HANDREMOTE_WEAPON: { - SetGameVarID(g_iReturnVarID,0,g_player[screenpeek].ps.i,screenpeek); - OnEvent(EVENT_DRAWWEAPON,g_player[screenpeek].ps.i,screenpeek, -1); - if (GetGameVarID(g_iReturnVarID,g_player[screenpeek].ps.i,screenpeek) == 0) + SetGameVarID(g_iReturnVarID,0,g_player[screenpeek].ps->i,screenpeek); + OnEvent(EVENT_DRAWWEAPON,g_player[screenpeek].ps->i,screenpeek, -1); + if (GetGameVarID(g_iReturnVarID,g_player[screenpeek].ps->i,screenpeek) == 0) { signed char remote_frames[] = {0,1,1,2,1,1,0,0,0,0,0}; if (sprite[p->i].pal == 1) @@ -2542,9 +2542,9 @@ void displayweapon(int snum) case DEVISTATOR_WEAPON: - SetGameVarID(g_iReturnVarID,0,g_player[screenpeek].ps.i,screenpeek); - OnEvent(EVENT_DRAWWEAPON,g_player[screenpeek].ps.i,screenpeek, -1); - if (GetGameVarID(g_iReturnVarID,g_player[screenpeek].ps.i,screenpeek) == 0) + SetGameVarID(g_iReturnVarID,0,g_player[screenpeek].ps->i,screenpeek); + OnEvent(EVENT_DRAWWEAPON,g_player[screenpeek].ps->i,screenpeek, -1); + if (GetGameVarID(g_iReturnVarID,g_player[screenpeek].ps->i,screenpeek) == 0) { if (sprite[p->i].pal == 1) pal = 1; @@ -2578,9 +2578,9 @@ void displayweapon(int snum) case FREEZE_WEAPON: - SetGameVarID(g_iReturnVarID,0,g_player[screenpeek].ps.i,screenpeek); - OnEvent(EVENT_DRAWWEAPON,g_player[screenpeek].ps.i,screenpeek, -1); - if (GetGameVarID(g_iReturnVarID,g_player[screenpeek].ps.i,screenpeek) == 0) + SetGameVarID(g_iReturnVarID,0,g_player[screenpeek].ps->i,screenpeek); + OnEvent(EVENT_DRAWWEAPON,g_player[screenpeek].ps->i,screenpeek, -1); + if (GetGameVarID(g_iReturnVarID,g_player[screenpeek].ps->i,screenpeek) == 0) { if (sprite[p->i].pal == 1) pal = 1; @@ -2606,9 +2606,9 @@ void displayweapon(int snum) case GROW_WEAPON: - SetGameVarID(g_iReturnVarID,0,g_player[screenpeek].ps.i,screenpeek); - OnEvent(EVENT_DRAWWEAPON,g_player[screenpeek].ps.i,screenpeek, -1); - if (GetGameVarID(g_iReturnVarID,g_player[screenpeek].ps.i,screenpeek) == 0) + SetGameVarID(g_iReturnVarID,0,g_player[screenpeek].ps->i,screenpeek); + OnEvent(EVENT_DRAWWEAPON,g_player[screenpeek].ps->i,screenpeek, -1); + if (GetGameVarID(g_iReturnVarID,g_player[screenpeek].ps->i,screenpeek) == 0) { weapon_xoffset += 28; looking_arc += 18; @@ -2648,9 +2648,9 @@ void displayweapon(int snum) case SHRINKER_WEAPON: - SetGameVarID(g_iReturnVarID,0,g_player[screenpeek].ps.i,screenpeek); - OnEvent(EVENT_DRAWWEAPON,g_player[screenpeek].ps.i,screenpeek, -1); - if (GetGameVarID(g_iReturnVarID,g_player[screenpeek].ps.i,screenpeek) == 0) + SetGameVarID(g_iReturnVarID,0,g_player[screenpeek].ps->i,screenpeek); + OnEvent(EVENT_DRAWWEAPON,g_player[screenpeek].ps->i,screenpeek, -1); + if (GetGameVarID(g_iReturnVarID,g_player[screenpeek].ps->i,screenpeek) == 0) { weapon_xoffset += 28; looking_arc += 18; @@ -2716,7 +2716,7 @@ void getinput(int snum) int32 turnamount; int32 keymove; int32 momx = 0,momy = 0; - player_struct *p = &g_player[snum].ps; + player_struct *p = g_player[snum].ps; if ((p->gm&MODE_MENU) || (p->gm&MODE_TYPE) || (ud.pause_on && !KB_KeyPressed(sc_Pause)) || (numplayers > 1 && totalclock < 10)) // HACK: kill getinput() for the first 10 tics of a new map in multi { @@ -2728,7 +2728,7 @@ void getinput(int snum) loc.avel = angvel = 0; loc.horz = horiz = 0; loc.bits = (((long)gamequit)<<26); - loc.extbits = (g_player[snum].pteam != g_player[snum].ps.team)<<6; + loc.extbits = (g_player[snum].pteam != g_player[snum].ps->team)<<6; loc.extbits |= (1<<7); return; } @@ -2820,7 +2820,7 @@ void getinput(int snum) loc.bits |= BUTTON(gamefunc_Look_Left)<<6; loc.bits |= BUTTON(gamefunc_Look_Right)<<7; - if (aplWeaponFlags[g_player[snum].ps.curr_weapon][snum] & WEAPON_FLAG_SEMIAUTO && BUTTON(gamefunc_Fire)) + if (aplWeaponFlags[g_player[snum].ps->curr_weapon][snum] & WEAPON_FLAG_SEMIAUTO && BUTTON(gamefunc_Fire)) CONTROL_ClearButton(gamefunc_Fire); if (jump_input > 0) @@ -2935,9 +2935,9 @@ void getinput(int snum) if (BUTTON(gamefunc_Strafe)) { - if (BUTTON(gamefunc_Turn_Left) && !(g_player[snum].ps.movement_lock&4)) + if (BUTTON(gamefunc_Turn_Left) && !(g_player[snum].ps->movement_lock&4)) svel -= -keymove; - if (BUTTON(gamefunc_Turn_Right) && !(g_player[snum].ps.movement_lock&8)) + if (BUTTON(gamefunc_Turn_Right) && !(g_player[snum].ps->movement_lock&8)) svel -= keymove; } else @@ -2962,13 +2962,13 @@ void getinput(int snum) turnheldtime=0; } - if (BUTTON(gamefunc_Strafe_Left) && !(g_player[snum].ps.movement_lock&4)) + if (BUTTON(gamefunc_Strafe_Left) && !(g_player[snum].ps->movement_lock&4)) svel += keymove; - if (BUTTON(gamefunc_Strafe_Right) && !(g_player[snum].ps.movement_lock&8)) + if (BUTTON(gamefunc_Strafe_Right) && !(g_player[snum].ps->movement_lock&8)) svel += -keymove; - if (BUTTON(gamefunc_Move_Forward) && !(g_player[snum].ps.movement_lock&1)) + if (BUTTON(gamefunc_Move_Forward) && !(g_player[snum].ps->movement_lock&1)) vel += keymove; - if (BUTTON(gamefunc_Move_Backward) && !(g_player[snum].ps.movement_lock&2)) + if (BUTTON(gamefunc_Move_Backward) && !(g_player[snum].ps->movement_lock&2)) vel += -keymove; if (vel < -MAXVEL) vel = -MAXVEL; @@ -2986,7 +2986,7 @@ void getinput(int snum) loc.extbits |= BUTTON(gamefunc_Strafe_Right)<<3; loc.extbits |= BUTTON(gamefunc_Turn_Left)<<4; loc.extbits |= BUTTON(gamefunc_Turn_Right)<<5; - loc.extbits |= (g_player[snum].pteam != g_player[snum].ps.team)<<6; + loc.extbits |= (g_player[snum].pteam != g_player[snum].ps->team)<<6; if (ud.scrollmode && ud.overhead_on) { @@ -3023,7 +3023,7 @@ static int doincrements(player_struct *p) { int snum = sprite[p->i].yvel; - // j = g_player[snum].sync.avel; + // j = g_player[snum].sync->avel; // p->weapon_ang = -(j/5); if (p->invdisptime > 0) @@ -3212,7 +3212,7 @@ static int doincrements(player_struct *p) spritesound(DUKE_CRACK_FIRST,p->i); } - else if (p->knuckle_incs == 22 || (g_player[snum].sync.bits&(1<<2))) + else if (p->knuckle_incs == 22 || (g_player[snum].sync->bits&(1<<2))) p->knuckle_incs=0; return 1; @@ -3254,7 +3254,7 @@ void processinput(int snum) unsigned long sb_snum; int psect, psectlotag; short *kb, tempsect; - player_struct *p = &g_player[snum].ps; + player_struct *p = g_player[snum].ps; int pi = p->i; spritetype *s = &sprite[pi]; @@ -3264,7 +3264,7 @@ void processinput(int snum) OnEvent(EVENT_PROCESSINPUT, pi, snum, -1); - if (p->cheat_phase <= 0) sb_snum = g_player[snum].sync.bits; + if (p->cheat_phase <= 0) sb_snum = g_player[snum].sync->bits; else sb_snum = 0; if ((sb_snum&(1<<2))) @@ -3412,7 +3412,7 @@ void processinput(int snum) } } for (i=connecthead;i>=0;i=connectpoint2[i]) - g_player[i].ps.gm = MODE_EOL; + g_player[i].ps->gm = MODE_EOL; p->fist_incs = 0; return; @@ -3435,7 +3435,7 @@ void processinput(int snum) else if (p->timebeforeexit == 1) { for (i=connecthead;i>=0;i=connectpoint2[i]) - g_player[i].ps.gm = MODE_EOL; + g_player[i].ps->gm = MODE_EOL; if (ud.from_bonus) { ud.level_number = ud.from_bonus; @@ -3457,12 +3457,12 @@ void processinput(int snum) p->select_dir = 0; else { - if(g_player[snum].sync.fvel > 127) + if(g_player[snum].sync->fvel > 127) { p->select_dir = 0; activatewarpelevators(pi,-1); } - else if(g_player[snum].sync.fvel <= -127) + else if(g_player[snum].sync->fvel <= -127) { p->select_dir = 0; activatewarpelevators(pi,1); @@ -3527,11 +3527,11 @@ void processinput(int snum) { if (p->frag_ps != snum) { - if (GTFLAGS(GAMETYPE_FLAG_TDM) && g_player[p->frag_ps].ps.team == g_player[snum].ps.team) - g_player[p->frag_ps].ps.fraggedself++; + if (GTFLAGS(GAMETYPE_FLAG_TDM) && g_player[p->frag_ps].ps->team == g_player[snum].ps->team) + g_player[p->frag_ps].ps->fraggedself++; else { - g_player[p->frag_ps].ps.frag++; + g_player[p->frag_ps].ps->frag++; g_player[p->frag_ps].frags[snum]++; } @@ -3543,14 +3543,14 @@ void processinput(int snum) else { Bsprintf(fta_quotes[116],"KILLED %s",&g_player[snum].user_name[0]); - FTA(116,&g_player[p->frag_ps].ps); + FTA(116,g_player[p->frag_ps].ps); } if (ud.deathmsgs) { char name1[32],name2[32]; - if (GTFLAGS(GAMETYPE_FLAG_PLAYERSFRIENDLY) || (GTFLAGS(GAMETYPE_FLAG_TDM) && g_player[snum].ps.team == g_player[p->frag_ps].ps.team)) + if (GTFLAGS(GAMETYPE_FLAG_PLAYERSFRIENDLY) || (GTFLAGS(GAMETYPE_FLAG_TDM) && g_player[snum].ps->team == g_player[p->frag_ps].ps->team)) i = 9; else { @@ -3562,7 +3562,7 @@ void processinput(int snum) else i = 0; break; case SHOTSPARK1__STATIC: - switch (g_player[p->frag_ps].ps.curr_weapon) + switch (g_player[p->frag_ps].ps->curr_weapon) { default: case PISTOL_WEAPON: @@ -3738,7 +3738,7 @@ void processinput(int snum) if (p->on_crane >= 0) goto HORIZONLY; - j = ksgn(g_player[snum].sync.avel); + j = ksgn(g_player[snum].sync->avel); /* if( j && ud.screen_tilting == 2) { @@ -4176,10 +4176,10 @@ void processinput(int snum) p->posxv = 0; p->posyv = 0; } - else if (g_player[snum].sync.avel) //p->ang += syncangvel * constant + else if (g_player[snum].sync->avel) //p->ang += syncangvel * constant { //ENGINE calculates angvel for you - long tempang = g_player[snum].sync.avel<<1; + long tempang = g_player[snum].sync->avel<<1; if (psectlotag == 2) p->angvel =(tempang-(tempang>>3))*ksgn(doubvel); else p->angvel = tempang*ksgn(doubvel); @@ -4285,25 +4285,25 @@ void processinput(int snum) } } - if (g_player[snum].sync.extbits&(1)) + if (g_player[snum].sync->extbits&(1)) OnEvent(EVENT_MOVEFORWARD,pi,snum, -1); - if (g_player[snum].sync.extbits&(1<<1)) + if (g_player[snum].sync->extbits&(1<<1)) OnEvent(EVENT_MOVEBACKWARD,pi,snum, -1); - if (g_player[snum].sync.extbits&(1<<2)) + if (g_player[snum].sync->extbits&(1<<2)) OnEvent(EVENT_STRAFELEFT,pi,snum, -1); - if (g_player[snum].sync.extbits&(1<<3)) + if (g_player[snum].sync->extbits&(1<<3)) OnEvent(EVENT_STRAFERIGHT,pi,snum, -1); - if (g_player[snum].sync.extbits&(1<<4) || g_player[snum].sync.avel < 0) + if (g_player[snum].sync->extbits&(1<<4) || g_player[snum].sync->avel < 0) OnEvent(EVENT_TURNLEFT,pi,snum, -1); - if (g_player[snum].sync.extbits&(1<<5) || g_player[snum].sync.avel > 0) + if (g_player[snum].sync->extbits&(1<<5) || g_player[snum].sync->avel > 0) OnEvent(EVENT_TURNRIGHT,pi,snum, -1); - if (p->posxv || p->posyv || g_player[snum].sync.fvel || g_player[snum].sync.svel) + if (p->posxv || p->posyv || g_player[snum].sync->fvel || g_player[snum].sync->svel) { p->crack_time = 777; @@ -4344,8 +4344,8 @@ void processinput(int snum) if (p->jetpack_on == 0 && p->steroids_amount > 0 && p->steroids_amount < 400) doubvel <<= 1; - p->posxv += ((g_player[snum].sync.fvel*doubvel)<<6); - p->posyv += ((g_player[snum].sync.svel*doubvel)<<6); + p->posxv += ((g_player[snum].sync->fvel*doubvel)<<6); + p->posyv += ((g_player[snum].sync->svel*doubvel)<<6); if ((aplWeaponWorksLike[p->curr_weapon] == KNEE_WEAPON && *kb > 10 && p->on_ground) || (p->on_ground && (sb_snum&2))) { @@ -4551,7 +4551,7 @@ HORIZONLY: if (p->horiz > 95 && p->horiz < 105) p->horiz = 100; if (p->horizoff > -5 && p->horizoff < 5) p->horizoff = 0; } - p->horiz += g_player[snum].sync.horz; + p->horiz += g_player[snum].sync->horz; if (p->horiz > 299) p->horiz = 299; else if (p->horiz < -99) p->horiz = -99; @@ -4610,8 +4610,8 @@ HORIZONLY: if (sprite[p->actorsqu].picnum == APLAYER) { - quickkill(&g_player[sprite[p->actorsqu].yvel].ps); - g_player[sprite[p->actorsqu].yvel].ps.frag_ps = snum; + quickkill(g_player[sprite[p->actorsqu].yvel].ps); + g_player[sprite[p->actorsqu].yvel].ps->frag_ps = snum; } else if (badguy(&sprite[p->actorsqu])) { @@ -5123,64 +5123,64 @@ int getspritescore(long snum, long dapicnum) return(120); case FREEZEAMMO__STATIC: - if (g_player[snum].ps.ammo_amount[FREEZE_WEAPON] < max_ammo_amount[FREEZE_WEAPON]) return(10); + if (g_player[snum].ps->ammo_amount[FREEZE_WEAPON] < max_ammo_amount[FREEZE_WEAPON]) return(10); return(1); case AMMO__STATIC: - if (g_player[snum].ps.ammo_amount[PISTOL_WEAPON] < max_ammo_amount[PISTOL_WEAPON]) return(10); + if (g_player[snum].ps->ammo_amount[PISTOL_WEAPON] < max_ammo_amount[PISTOL_WEAPON]) return(10); return(1); case BATTERYAMMO__STATIC: - if (g_player[snum].ps.ammo_amount[CHAINGUN_WEAPON] < max_ammo_amount[CHAINGUN_WEAPON]) return(20); + if (g_player[snum].ps->ammo_amount[CHAINGUN_WEAPON] < max_ammo_amount[CHAINGUN_WEAPON]) return(20); return(1); case DEVISTATORAMMO__STATIC: - if (g_player[snum].ps.ammo_amount[DEVISTATOR_WEAPON] < max_ammo_amount[DEVISTATOR_WEAPON]) return(25); + if (g_player[snum].ps->ammo_amount[DEVISTATOR_WEAPON] < max_ammo_amount[DEVISTATOR_WEAPON]) return(25); return(1); case RPGAMMO__STATIC: - if (g_player[snum].ps.ammo_amount[RPG_WEAPON] < max_ammo_amount[RPG_WEAPON]) return(50); + if (g_player[snum].ps->ammo_amount[RPG_WEAPON] < max_ammo_amount[RPG_WEAPON]) return(50); return(1); case CRYSTALAMMO__STATIC: - if (g_player[snum].ps.ammo_amount[SHRINKER_WEAPON] < max_ammo_amount[SHRINKER_WEAPON]) return(10); + if (g_player[snum].ps->ammo_amount[SHRINKER_WEAPON] < max_ammo_amount[SHRINKER_WEAPON]) return(10); return(1); case HBOMBAMMO__STATIC: - if (g_player[snum].ps.ammo_amount[HANDBOMB_WEAPON] < max_ammo_amount[HANDBOMB_WEAPON]) return(30); + if (g_player[snum].ps->ammo_amount[HANDBOMB_WEAPON] < max_ammo_amount[HANDBOMB_WEAPON]) return(30); return(1); case SHOTGUNAMMO__STATIC: - if (g_player[snum].ps.ammo_amount[SHOTGUN_WEAPON] < max_ammo_amount[SHOTGUN_WEAPON]) return(25); + if (g_player[snum].ps->ammo_amount[SHOTGUN_WEAPON] < max_ammo_amount[SHOTGUN_WEAPON]) return(25); return(1); case COLA__STATIC: - if (sprite[g_player[snum].ps.i].extra < 100) return(10); + if (sprite[g_player[snum].ps->i].extra < 100) return(10); return(1); case SIXPAK__STATIC: - if (sprite[g_player[snum].ps.i].extra < 100) return(30); + if (sprite[g_player[snum].ps->i].extra < 100) return(30); return(1); case FIRSTAID__STATIC: - if (g_player[snum].ps.firstaid_amount < 100) return(100); + if (g_player[snum].ps->firstaid_amount < 100) return(100); return(1); case SHIELD__STATIC: - if (g_player[snum].ps.shield_amount < 100) return(50); + if (g_player[snum].ps->shield_amount < 100) return(50); return(1); case STEROIDS__STATIC: - if (g_player[snum].ps.steroids_amount < 400) return(30); + if (g_player[snum].ps->steroids_amount < 400) return(30); return(1); case AIRTANK__STATIC: - if (g_player[snum].ps.scuba_amount < 6400) return(30); + if (g_player[snum].ps->scuba_amount < 6400) return(30); return(1); case JETPACK__STATIC: - if (g_player[snum].ps.jetpack_amount < 1600) return(100); + if (g_player[snum].ps->jetpack_amount < 1600) return(100); return(1); case HEATSENSOR__STATIC: - if (g_player[snum].ps.heat_amount < 1200) return(5); + if (g_player[snum].ps->heat_amount < 1200) return(5); return(1); case ACCESSCARD__STATIC: return(1); case BOOTS__STATIC: - if (g_player[snum].ps.boot_amount < 200) return(15); + if (g_player[snum].ps->boot_amount < 200) return(15); return(1); case ATOMICHEALTH__STATIC: - if (sprite[g_player[snum].ps.i].extra < max_player_health<<1) return(50); + if (sprite[g_player[snum].ps->i].extra < max_player_health<<1) return(50); return(1); case HOLODUKE__STATIC: - if (g_player[snum].ps.holoduke_amount < 2400) return(5); + if (g_player[snum].ps->holoduke_amount < 2400) return(5); return(1); case MUSICANDSFX__STATIC: return(1); @@ -5216,7 +5216,7 @@ void computergetinput(long snum, input *syn) long dist, daang, zang, fightdist, damyang, damysect; long startsect, endsect, splc, send, startwall, endwall; short dasect, dawall, daspr; - player_struct *p = &g_player[snum].ps; + player_struct *p = g_player[snum].ps; walltype *wal; syn->fvel = 0; @@ -5242,26 +5242,26 @@ void computergetinput(long snum, input *syn) if (!(numframes&7)) { - x2 = sprite[g_player[goalplayer[snum]].ps.i].x; - y2 = sprite[g_player[goalplayer[snum]].ps.i].y; - z2 = sprite[g_player[goalplayer[snum]].ps.i].z; + x2 = sprite[g_player[goalplayer[snum]].ps->i].x; + y2 = sprite[g_player[goalplayer[snum]].ps->i].y; + z2 = sprite[g_player[goalplayer[snum]].ps->i].z; - if (!cansee(x1,y1,z1-(48<<8),damysect,x2,y2,z2-(48<<8),sprite[g_player[goalplayer[snum]].ps.i].sectnum)) + if (!cansee(x1,y1,z1-(48<<8),damysect,x2,y2,z2-(48<<8),sprite[g_player[goalplayer[snum]].ps->i].sectnum)) goalplayer[snum] = snum; } - if ((goalplayer[snum] == snum) || (g_player[goalplayer[snum]].ps.dead_flag != 0)) + if ((goalplayer[snum] == snum) || (g_player[goalplayer[snum]].ps->dead_flag != 0)) { j = 0x7fffffff; for (i=connecthead;i>=0;i=connectpoint2[i]) - if (i != snum && !(GTFLAGS(GAMETYPE_FLAG_TDM) && g_player[snum].ps.team == g_player[i].ps.team)) + if (i != snum && !(GTFLAGS(GAMETYPE_FLAG_TDM) && g_player[snum].ps->team == g_player[i].ps->team)) { - dist = ksqrt((sprite[g_player[i].ps.i].x-x1)*(sprite[g_player[i].ps.i].x-x1)+(sprite[g_player[i].ps.i].y-y1)*(sprite[g_player[i].ps.i].y-y1)); + dist = ksqrt((sprite[g_player[i].ps->i].x-x1)*(sprite[g_player[i].ps->i].x-x1)+(sprite[g_player[i].ps->i].y-y1)*(sprite[g_player[i].ps->i].y-y1)); - x2 = sprite[g_player[i].ps.i].x; - y2 = sprite[g_player[i].ps.i].y; - z2 = sprite[g_player[i].ps.i].z; - if (!cansee(x1,y1,z1-(48<<8),damysect,x2,y2,z2-(48<<8),sprite[g_player[i].ps.i].sectnum)) + x2 = sprite[g_player[i].ps->i].x; + y2 = sprite[g_player[i].ps->i].y; + z2 = sprite[g_player[i].ps->i].z; + if (!cansee(x1,y1,z1-(48<<8),damysect,x2,y2,z2-(48<<8),sprite[g_player[i].ps->i].sectnum)) dist <<= 1; if (dist < j) @@ -5273,9 +5273,9 @@ void computergetinput(long snum, input *syn) } } - x2 = sprite[g_player[goalplayer[snum]].ps.i].x; - y2 = sprite[g_player[goalplayer[snum]].ps.i].y; - z2 = sprite[g_player[goalplayer[snum]].ps.i].z; + x2 = sprite[g_player[goalplayer[snum]].ps->i].x; + y2 = sprite[g_player[goalplayer[snum]].ps->i].y; + z2 = sprite[g_player[goalplayer[snum]].ps->i].z; if (p->dead_flag) syn->bits |= (1<<29); if ((p->firstaid_amount > 0) && (p->last_extra < 100)) @@ -5335,10 +5335,10 @@ void computergetinput(long snum, input *syn) } } - if ((g_player[goalplayer[snum]].ps.dead_flag == 0) && - ((cansee(x1,y1,z1,damysect,x2,y2,z2,sprite[g_player[goalplayer[snum]].ps.i].sectnum)) || - (cansee(x1,y1,z1-(24<<8),damysect,x2,y2,z2-(24<<8),sprite[g_player[goalplayer[snum]].ps.i].sectnum)) || - (cansee(x1,y1,z1-(48<<8),damysect,x2,y2,z2-(48<<8),sprite[g_player[goalplayer[snum]].ps.i].sectnum)))) + if ((g_player[goalplayer[snum]].ps->dead_flag == 0) && + ((cansee(x1,y1,z1,damysect,x2,y2,z2,sprite[g_player[goalplayer[snum]].ps->i].sectnum)) || + (cansee(x1,y1,z1-(24<<8),damysect,x2,y2,z2-(24<<8),sprite[g_player[goalplayer[snum]].ps->i].sectnum)) || + (cansee(x1,y1,z1-(48<<8),damysect,x2,y2,z2-(48<<8),sprite[g_player[goalplayer[snum]].ps->i].sectnum)))) { syn->bits |= (1<<2); @@ -5356,20 +5356,20 @@ void computergetinput(long snum, input *syn) } - fightdist = fdmatrix[p->curr_weapon][g_player[goalplayer[snum]].ps.curr_weapon]; + fightdist = fdmatrix[p->curr_weapon][g_player[goalplayer[snum]].ps->curr_weapon]; if (fightdist < 128) fightdist = 128; dist = ksqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1)); if (dist == 0) dist = 1; - daang = getangle(x2+(g_player[goalplayer[snum]].ps.posxv>>14)-x1,y2+(g_player[goalplayer[snum]].ps.posyv>>14)-y1); + daang = getangle(x2+(g_player[goalplayer[snum]].ps->posxv>>14)-x1,y2+(g_player[goalplayer[snum]].ps->posyv>>14)-y1); zang = 100-((z2-z1)*8)/dist; fightdist = max(fightdist,(klabs(z2-z1)>>4)); - if (sprite[g_player[goalplayer[snum]].ps.i].yrepeat < 32) + if (sprite[g_player[goalplayer[snum]].ps->i].yrepeat < 32) { fightdist = 0; syn->bits &= ~(1<<2); } - if (sprite[g_player[goalplayer[snum]].ps.i].pal == 1) + if (sprite[g_player[goalplayer[snum]].ps->i].pal == 1) { fightdist = 0; syn->bits &= ~(1<<2); @@ -5390,8 +5390,8 @@ void computergetinput(long snum, input *syn) i += sintable[((j+4245)<<5)&2047]; i += sintable[((j+6745)<<4)&2047]; i += sintable[((j+15685)<<3)&2047]; - dx = sintable[(sprite[g_player[goalplayer[snum]].ps.i].ang+512)&2047]; - dy = sintable[sprite[g_player[goalplayer[snum]].ps.i].ang&2047]; + dx = sintable[(sprite[g_player[goalplayer[snum]].ps->i].ang+512)&2047]; + dy = sintable[sprite[g_player[goalplayer[snum]].ps->i].ang&2047]; if ((x1-x2)*dy > (y1-y2)*dx) i += 8192; else i -= 8192; syn->fvel += ((sintable[(daang+1024)&2047]*i)>>17); @@ -5409,7 +5409,7 @@ void computergetinput(long snum, input *syn) { goalwall[snum] = -1; startsect = sprite[p->i].sectnum; - endsect = sprite[g_player[goalplayer[snum]].ps.i].sectnum; + endsect = sprite[g_player[goalplayer[snum]].ps->i].sectnum; clearbufbyte(dashow2dsector,(MAXSECTORS+7)>>3,0L); searchsect[0] = startsect; diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index 8b521b6b5..59bb291a2 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -34,7 +34,7 @@ extern char pow2char[]; extern int everyothertime; static int which_palookup = 9; -char numl; +int g_NumPalettes; short spritecache[MAXTILES][3]; static char precachehightile[2][MAXTILES>>3]; @@ -325,8 +325,8 @@ static void dofrontscreens(char *statustext) { if (!statustext) { - //g_player[myconnectindex].ps.palette = palette; - setgamepalette(&g_player[myconnectindex].ps, palette, 1); // JBF 20040308 + //g_player[myconnectindex].ps->palette = palette; + setgamepalette(g_player[myconnectindex].ps, palette, 1); // JBF 20040308 fadepal(0,0,0, 0,64,7); i = ud.screen_size; ud.screen_size = 0; @@ -372,9 +372,9 @@ static void dofrontscreens(char *statustext) if (!statustext) { clearview(0L); - //g_player[myconnectindex].ps.palette = palette; + //g_player[myconnectindex].ps->palette = palette; //palto(0,0,0,0); - setgamepalette(&g_player[myconnectindex].ps, palette, 0); // JBF 20040308 + setgamepalette(g_player[myconnectindex].ps, palette, 0); // JBF 20040308 } SetGameVarID(g_iReturnVarID,LOADSCREEN, -1, -1); OnEvent(EVENT_GETLOADTILE, -1, myconnectindex, -1); @@ -543,7 +543,7 @@ void vscrn(void) void pickrandomspot(int snum) { - player_struct *p = &g_player[snum].ps; + player_struct *p = g_player[snum].ps; int i=snum,j,k; unsigned long dist,pdist = -1; @@ -554,11 +554,11 @@ void pickrandomspot(int snum) { for (j=0;j 0) + if (j != snum && g_player[j].ps->team == g_player[snum].ps->team && sprite[g_player[j].ps->i].extra > 0) { for (k=0;kposx-g_PlayerSpawnPoints[k].ox,g_player[j].ps->posy-g_PlayerSpawnPoints[k].oy); if (dist < pdist) i = k, pdist = dist; } @@ -568,16 +568,16 @@ void pickrandomspot(int snum) } } - p->bobposx = p->oposx = p->posx = g_player[i].po.ox; - p->bobposy = p->oposy = p->posy = g_player[i].po.oy; - p->oposz = p->posz = g_player[i].po.oz; - p->ang = g_player[i].po.oa; - p->cursectnum = g_player[i].po.os; + p->bobposx = p->oposx = p->posx = g_PlayerSpawnPoints[i].ox; + p->bobposy = p->oposy = p->posy = g_PlayerSpawnPoints[i].oy; + p->oposz = p->posz = g_PlayerSpawnPoints[i].oz; + p->ang = g_PlayerSpawnPoints[i].oa; + p->cursectnum = g_PlayerSpawnPoints[i].os; } static void resetplayerstats(int snum) { - player_struct *p = &g_player[snum].ps; + player_struct *p = g_player[snum].ps; ud.show_help = 0; ud.showallmap = 0; @@ -686,7 +686,7 @@ static void resetplayerstats(int snum) void resetweapons(int snum) { int weapon; - player_struct *p = &g_player[snum].ps; + player_struct *p = g_player[snum].ps; for (weapon = PISTOL_WEAPON; weapon < MAX_WEAPONS; weapon++) p->gotweapon[weapon] = 0; @@ -710,7 +710,7 @@ void resetweapons(int snum) void resetinventory(int snum) { - player_struct *p = &g_player[snum].ps; + player_struct *p = g_player[snum].ps; p->inven_icon = 0; p->boot_amount = 0; @@ -731,7 +731,7 @@ void resetinventory(int snum) static void resetprestat(int snum,int g) { - player_struct *p = &g_player[snum].ps; + player_struct *p = g_player[snum].ps; int i; spriteqloc = 0; @@ -872,20 +872,20 @@ static void prelevel(char g) if (sector[i].ceilingpicnum == CLOUDYSKIES && numclouds < 127) clouds[numclouds++] = i; - if (g_player[0].ps.one_parallax_sectnum == -1) - g_player[0].ps.one_parallax_sectnum = i; + if (g_player[0].ps->one_parallax_sectnum == -1) + g_player[0].ps->one_parallax_sectnum = i; } if (sector[i].lotag == 32767) //Found a secret room { - g_player[0].ps.max_secret_rooms++; + g_player[0].ps->max_secret_rooms++; continue; } if (sector[i].lotag == -1) { - g_player[0].ps.exitx = wall[sector[i].wallptr].x; - g_player[0].ps.exity = wall[sector[i].wallptr].y; + g_player[0].ps->exitx = wall[sector[i].wallptr].x; + g_player[0].ps->exity = wall[sector[i].wallptr].y; continue; } } @@ -898,8 +898,8 @@ static void prelevel(char g) LoadActor(i); if (sprite[i].lotag == -1 && (sprite[i].cstat&16)) { - g_player[0].ps.exitx = SX; - g_player[0].ps.exity = SY; + g_player[0].ps->exitx = SX; + g_player[0].ps->exity = SY; } else switch (dynamictostatic[PN]) { @@ -1155,7 +1155,7 @@ static void prelevel(char g) void newgame(int vn,int ln,int sk) { - player_struct *p = &g_player[0].ps; + player_struct *p = g_player[0].ps; int i; handleevents(); @@ -1280,65 +1280,65 @@ static void resetpspritevars(char g) char aimmode[MAXPLAYERS],autoaim[MAXPLAYERS],weaponswitch[MAXPLAYERS]; STATUSBARTYPE tsbar[MAXPLAYERS]; - EGS(g_player[0].ps.cursectnum,g_player[0].ps.posx,g_player[0].ps.posy,g_player[0].ps.posz, - APLAYER,0,0,0,g_player[0].ps.ang,0,0,0,10); + EGS(g_player[0].ps->cursectnum,g_player[0].ps->posx,g_player[0].ps->posy,g_player[0].ps->posz, + APLAYER,0,0,0,g_player[0].ps->ang,0,0,0,10); - if (ud.recstat != 2) for (i=0;iaim_mode; + autoaim[i] = g_player[i].ps->auto_aim; + weaponswitch[i] = g_player[i].ps->weaponswitch; if (ud.multimode > 1 && (gametype_flags[ud.coop]&GAMETYPE_FLAG_PRESERVEINVENTORYDEATH) && ud.last_level >= 0) { for (j=0;jammo_amount[j]; + tsbar[i].gotweapon[j] = g_player[i].ps->gotweapon[j]; } - tsbar[i].shield_amount = g_player[i].ps.shield_amount; - tsbar[i].curr_weapon = g_player[i].ps.curr_weapon; - tsbar[i].inven_icon = g_player[i].ps.inven_icon; + tsbar[i].shield_amount = g_player[i].ps->shield_amount; + tsbar[i].curr_weapon = g_player[i].ps->curr_weapon; + tsbar[i].inven_icon = g_player[i].ps->inven_icon; - tsbar[i].firstaid_amount = g_player[i].ps.firstaid_amount; - tsbar[i].steroids_amount = g_player[i].ps.steroids_amount; - tsbar[i].holoduke_amount = g_player[i].ps.holoduke_amount; - tsbar[i].jetpack_amount = g_player[i].ps.jetpack_amount; - tsbar[i].heat_amount = g_player[i].ps.heat_amount; - tsbar[i].scuba_amount = g_player[i].ps.scuba_amount; - tsbar[i].boot_amount = g_player[i].ps.boot_amount; + tsbar[i].firstaid_amount = g_player[i].ps->firstaid_amount; + tsbar[i].steroids_amount = g_player[i].ps->steroids_amount; + tsbar[i].holoduke_amount = g_player[i].ps->holoduke_amount; + tsbar[i].jetpack_amount = g_player[i].ps->jetpack_amount; + tsbar[i].heat_amount = g_player[i].ps->heat_amount; + tsbar[i].scuba_amount = g_player[i].ps->scuba_amount; + tsbar[i].boot_amount = g_player[i].ps->boot_amount; } } resetplayerstats(0); - for (i=1;iaim_mode = aimmode[i]; + g_player[i].ps->auto_aim = autoaim[i]; + g_player[i].ps->weaponswitch = weaponswitch[i]; if (ud.multimode > 1 && (gametype_flags[ud.coop]&GAMETYPE_FLAG_PRESERVEINVENTORYDEATH) && ud.last_level >= 0) { for (j=0;jammo_amount[j] = tsbar[i].ammo_amount[j]; + g_player[i].ps->gotweapon[j] = tsbar[i].gotweapon[j]; } - g_player[i].ps.shield_amount = tsbar[i].shield_amount; - g_player[i].ps.curr_weapon = tsbar[i].curr_weapon; - g_player[i].ps.inven_icon = tsbar[i].inven_icon; + g_player[i].ps->shield_amount = tsbar[i].shield_amount; + g_player[i].ps->curr_weapon = tsbar[i].curr_weapon; + g_player[i].ps->inven_icon = tsbar[i].inven_icon; - g_player[i].ps.firstaid_amount = tsbar[i].firstaid_amount; - g_player[i].ps.steroids_amount= tsbar[i].steroids_amount; - g_player[i].ps.holoduke_amount = tsbar[i].holoduke_amount; - g_player[i].ps.jetpack_amount = tsbar[i].jetpack_amount; - g_player[i].ps.heat_amount = tsbar[i].heat_amount; - g_player[i].ps.scuba_amount= tsbar[i].scuba_amount; - g_player[i].ps.boot_amount = tsbar[i].boot_amount; + g_player[i].ps->firstaid_amount = tsbar[i].firstaid_amount; + g_player[i].ps->steroids_amount= tsbar[i].steroids_amount; + g_player[i].ps->holoduke_amount = tsbar[i].holoduke_amount; + g_player[i].ps->jetpack_amount = tsbar[i].jetpack_amount; + g_player[i].ps->heat_amount = tsbar[i].heat_amount; + g_player[i].ps->scuba_amount= tsbar[i].scuba_amount; + g_player[i].ps->boot_amount = tsbar[i].boot_amount; } } @@ -1358,15 +1358,15 @@ static void resetpspritevars(char g) if (numplayersprites == 0) { - firstx = g_player[0].ps.posx; - firsty = g_player[0].ps.posy; + firstx = g_player[0].ps->posx; + firsty = g_player[0].ps->posy; } - g_player[(unsigned char)numplayersprites].po.ox = s->x; - g_player[(unsigned char)numplayersprites].po.oy = s->y; - g_player[(unsigned char)numplayersprites].po.oz = s->z; - g_player[(unsigned char)numplayersprites].po.oa = s->ang; - g_player[(unsigned char)numplayersprites].po.os = s->sectnum; + g_PlayerSpawnPoints[(unsigned char)numplayersprites].ox = s->x; + g_PlayerSpawnPoints[(unsigned char)numplayersprites].oy = s->y; + g_PlayerSpawnPoints[(unsigned char)numplayersprites].oz = s->z; + g_PlayerSpawnPoints[(unsigned char)numplayersprites].oa = s->ang; + g_PlayerSpawnPoints[(unsigned char)numplayersprites].os = s->sectnum; numplayersprites++; if (j >= 0) @@ -1379,13 +1379,13 @@ static void resetpspritevars(char g) s->xoffset = 0; s->clipdist = 64; - if ((g&MODE_EOL) != MODE_EOL || g_player[j].ps.last_extra == 0) + if ((g&MODE_EOL) != MODE_EOL || g_player[j].ps->last_extra == 0) { - g_player[j].ps.last_extra = max_player_health; + g_player[j].ps->last_extra = max_player_health; s->extra = max_player_health; - g_player[j].ps.runspeed = dukefriction; + g_player[j].ps->runspeed = dukefriction; } - else s->extra = g_player[j].ps.last_extra; + else s->extra = g_player[j].ps->last_extra; s->yvel = j; @@ -1395,9 +1395,9 @@ static void resetpspritevars(char g) { int k = 0; - for (;kpalookup) { which_palookup++; if (which_palookup >= 17) @@ -1405,11 +1405,11 @@ static void resetpspritevars(char g) k=0; } } - g_player[j].pcolor = s->pal = g_player[j].ps.palookup = which_palookup++; + g_player[j].pcolor = s->pal = g_player[j].ps->palookup = which_palookup++; if (which_palookup >= 17) which_palookup = 9; } - else g_player[j].pcolor = g_player[j].ps.palookup = s->pal; + else g_player[j].pcolor = g_player[j].ps->palookup = s->pal; } else { @@ -1418,21 +1418,21 @@ static void resetpspritevars(char g) if (gametype_flags[ud.coop] & GAMETYPE_FLAG_TDM) { k = getteampal(g_player[j].pteam); - g_player[j].ps.team = g_player[j].pteam; + g_player[j].ps->team = g_player[j].pteam; } - s->pal = g_player[j].ps.palookup = k; + s->pal = g_player[j].ps->palookup = k; } - g_player[j].ps.i = i; - g_player[j].ps.frag_ps = j; + g_player[j].ps->i = i; + g_player[j].ps->frag_ps = j; hittype[i].owner = i; - hittype[i].bposx = g_player[j].ps.bobposx = g_player[j].ps.oposx = g_player[j].ps.posx = s->x; - hittype[i].bposy = g_player[j].ps.bobposy = g_player[j].ps.oposy = g_player[j].ps.posy = s->y; - hittype[i].bposz = g_player[j].ps.oposz = g_player[j].ps.posz = s->z; - g_player[j].ps.oang = g_player[j].ps.ang = s->ang; + hittype[i].bposx = g_player[j].ps->bobposx = g_player[j].ps->oposx = g_player[j].ps->posx = s->x; + hittype[i].bposy = g_player[j].ps->bobposy = g_player[j].ps->oposy = g_player[j].ps->posy = s->y; + hittype[i].bposz = g_player[j].ps->oposz = g_player[j].ps->posz = s->z; + g_player[j].ps->oang = g_player[j].ps->ang = s->ang; - updatesector(s->x,s->y,&g_player[j].ps.cursectnum); + updatesector(s->x,s->y,&g_player[j].ps->cursectnum); j = connectpoint2[j]; @@ -1446,11 +1446,11 @@ static inline void clearfrags(void) { int i = 0; - while (ifrag = g_player[i].ps->fraggedself = 0, i++; + clearbufbyte(&g_player[i].frags[0],MAXPLAYERS<<1,0L); + } } void resettimevars(void) @@ -1510,7 +1510,7 @@ extern int jump_input; void clearfifo(void) { - int i = 0; + int i = 0; syncvaltail = 0L; syncvaltottail = 0L; @@ -1523,37 +1523,40 @@ void clearfifo(void) avgfvel = avgsvel = avgavel = avghorz = avgbits = avgextbits = 0; otherminlag = mymaxlag = 0; - clearbufbyte(&loc,sizeof(input),0L); - clearbufbyte(inputfifo,sizeof(input)*MOVEFIFOSIZ*MAXPLAYERS,0L); - for (;iposx; + myy = omyy = g_player[myconnectindex].ps->posy; + myz = omyz = g_player[myconnectindex].ps->posz; myxvel = myyvel = myzvel = 0; - myang = omyang = g_player[myconnectindex].ps.ang; - myhoriz = omyhoriz = g_player[myconnectindex].ps.horiz; - myhorizoff = omyhorizoff = g_player[myconnectindex].ps.horizoff; - mycursectnum = g_player[myconnectindex].ps.cursectnum; - myjumpingcounter = g_player[myconnectindex].ps.jumping_counter; - myjumpingtoggle = g_player[myconnectindex].ps.jumping_toggle; - myonground = g_player[myconnectindex].ps.on_ground; - myhardlanding = g_player[myconnectindex].ps.hard_landing; - myreturntocenter = g_player[myconnectindex].ps.return_to_center; + myang = omyang = g_player[myconnectindex].ps->ang; + myhoriz = omyhoriz = g_player[myconnectindex].ps->horiz; + myhorizoff = omyhorizoff = g_player[myconnectindex].ps->horizoff; + mycursectnum = g_player[myconnectindex].ps->cursectnum; + myjumpingcounter = g_player[myconnectindex].ps->jumping_counter; + myjumpingtoggle = g_player[myconnectindex].ps->jumping_toggle; + myonground = g_player[myconnectindex].ps->on_ground; + myhardlanding = g_player[myconnectindex].ps->hard_landing; + myreturntocenter = g_player[myconnectindex].ps->return_to_center; } -extern int gotvote[MAXPLAYERS], votes[MAXPLAYERS], voting, vote_map, vote_episode; +extern int voting, vote_map, vote_episode; static void getlevelfromfilename(const char *fn, char *volume, char *level) { @@ -1582,6 +1585,8 @@ int enterlevel(int g) waitforeverybody(); ready2send = 0; + vote_map = vote_episode = voting = -1; + if ((g&MODE_DEMO) != MODE_DEMO) ud.recstat = ud.m_recstat; ud.respawn_monsters = ud.m_respawn_monsters; ud.respawn_items = ud.m_respawn_items; @@ -1592,10 +1597,6 @@ int enterlevel(int g) ud.ffire = ud.m_ffire; ud.noexits = ud.m_noexits; - vote_map = vote_episode = voting = -1; - Bmemset(votes,0,sizeof(votes)); - Bmemset(gotvote,0,sizeof(gotvote)); - if ((g&MODE_DEMO) == 0 && ud.recstat == 2) ud.recstat = 0; @@ -1661,7 +1662,7 @@ int enterlevel(int g) { if (boardfilename[0] != 0 && ud.m_level_number == 7 && ud.m_volume_number == 0) { - if (loadboard(boardfilename,0,&g_player[0].ps.posx, &g_player[0].ps.posy, &g_player[0].ps.posz, &g_player[0].ps.ang,&g_player[0].ps.cursectnum) == -1) + if (loadboard(boardfilename,0,&g_player[0].ps->posx, &g_player[0].ps->posy, &g_player[0].ps->posz, &g_player[0].ps->ang,&g_player[0].ps->cursectnum) == -1) { initprintf("Map '%s' not found!\n",boardfilename); //gameexit(tempbuf); @@ -1683,7 +1684,7 @@ int enterlevel(int g) if (!loadmaphack(levname)) initprintf("Loaded map hack file '%s'\n",levname); } } - else if (loadboard(map[(ud.volume_number*MAXLEVELS)+ud.level_number].filename,0,&g_player[0].ps.posx, &g_player[0].ps.posy, &g_player[0].ps.posz, &g_player[0].ps.ang,&g_player[0].ps.cursectnum) == -1) + else if (loadboard(map[(ud.volume_number*MAXLEVELS)+ud.level_number].filename,0,&g_player[0].ps->posx, &g_player[0].ps->posy, &g_player[0].ps->posz, &g_player[0].ps->ang,&g_player[0].ps->cursectnum) == -1) { initprintf("Map %s not found!\n",map[(ud.volume_number*MAXLEVELS)+ud.level_number].filename); //gameexit(tempbuf); @@ -1714,7 +1715,7 @@ int enterlevel(int g) levname[i] = 255; levname[i+1] = 0; - if (loadboard(levname,1,&g_player[0].ps.posx, &g_player[0].ps.posy, &g_player[0].ps.posz, &g_player[0].ps.ang,&g_player[0].ps.cursectnum) == -1) + if (loadboard(levname,1,&g_player[0].ps->posx, &g_player[0].ps->posy, &g_player[0].ps->posz, &g_player[0].ps->ang,&g_player[0].ps->cursectnum) == -1) { initprintf("Map '%s' not found!\n",map[(ud.volume_number*MAXLEVELS)+ud.level_number].filename); //gameexit(tempbuf); @@ -1761,12 +1762,12 @@ int enterlevel(int g) } if ((g&MODE_GAME) || (g&MODE_EOL)) - g_player[myconnectindex].ps.gm = MODE_GAME; + g_player[myconnectindex].ps->gm = MODE_GAME; else if (g&MODE_RESTART) { if (ud.recstat == 2) - g_player[myconnectindex].ps.gm = MODE_DEMO; - else g_player[myconnectindex].ps.gm = MODE_GAME; + g_player[myconnectindex].ps->gm = MODE_DEMO; + else g_player[myconnectindex].ps->gm = MODE_GAME; } if ((ud.recstat == 1) && (g&MODE_RESTART) != MODE_RESTART) @@ -1774,21 +1775,21 @@ int enterlevel(int g) if (VOLUMEONE) { - if (ud.level_number == 0 && ud.recstat != 2) FTA(40,&g_player[myconnectindex].ps); + if (ud.level_number == 0 && ud.recstat != 2) FTA(40,g_player[myconnectindex].ps); } for (i=connecthead;i>=0;i=connectpoint2[i]) - switch (dynamictostatic[sector[sprite[g_player[i].ps.i].sectnum].floorpicnum]) + switch (dynamictostatic[sector[sprite[g_player[i].ps->i].sectnum].floorpicnum]) { case HURTRAIL__STATIC: case FLOORSLIME__STATIC: case FLOORPLASMA__STATIC: resetweapons(i); resetinventory(i); - g_player[i].ps.gotweapon[PISTOL_WEAPON] = 0; - g_player[i].ps.ammo_amount[PISTOL_WEAPON] = 0; - g_player[i].ps.curr_weapon = KNEE_WEAPON; - g_player[i].ps.kickback_pic = 0; + g_player[i].ps->gotweapon[PISTOL_WEAPON] = 0; + g_player[i].ps->ammo_amount[PISTOL_WEAPON] = 0; + g_player[i].ps->curr_weapon = KNEE_WEAPON; + g_player[i].ps->kickback_pic = 0; break; } @@ -1796,11 +1797,11 @@ int enterlevel(int g) resetmys(); - //g_player[myconnectindex].ps.palette = palette; + //g_player[myconnectindex].ps->palette = palette; //palto(0,0,0,0); - setgamepalette(&g_player[myconnectindex].ps, palette, 0); // JBF 20040308 + setgamepalette(g_player[myconnectindex].ps, palette, 0); // JBF 20040308 - setpal(&g_player[myconnectindex].ps); + setpal(g_player[myconnectindex].ps); flushperms(); everyothertime = 0; @@ -1823,9 +1824,9 @@ int enterlevel(int g) drawbackground(); displayrooms(myconnectindex,65536); - for (i=0;iover_shoulder_on = 0; clearfrags(); diff --git a/polymer/eduke32/source/savegame.c b/polymer/eduke32/source/savegame.c index 772ba4f75..8126c3c8e 100644 --- a/polymer/eduke32/source/savegame.c +++ b/polymer/eduke32/source/savegame.c @@ -93,7 +93,7 @@ int loadpheader(char spot,struct savehead *saveh) if (kdfread(&bv,4,1,fil) != 1) goto corrupt; if (bv != BYTEVERSION && bv != BYTEVERSION_COMPAT) { - FTA(114,&g_player[myconnectindex].ps); + FTA(114,g_player[myconnectindex].ps); kclose(fil); return 1; } @@ -170,7 +170,7 @@ int loadplayer(int spot) if (kdfread(&bv,4,1,fil) != 1) return -1; if (bv != BYTEVERSION && bv != BYTEVERSION_COMPAT) { - FTA(114,&g_player[myconnectindex].ps); + FTA(114,g_player[myconnectindex].ps); kclose(fil); ototalclock = totalclock; ready2send = 1; @@ -183,7 +183,7 @@ int loadplayer(int spot) kclose(fil); ototalclock = totalclock; ready2send = 1; - FTA(124,&g_player[myconnectindex].ps); + FTA(124,g_player[myconnectindex].ps); return 1; } else ud.multimode = nump; @@ -244,10 +244,9 @@ int loadplayer(int spot) if (kdfread(&nextspritestat[0],2,MAXSPRITES,fil) != MAXSPRITES) goto corrupt; if (kdfread(&numcyclers,sizeof(numcyclers),1,fil) != 1) goto corrupt; if (kdfread(&cyclers[0][0],12,MAXCYCLERS,fil) != MAXCYCLERS) goto corrupt; - for (i=0;iover_shoulder_on != 0) { cameradist = 0; cameraclock = 0; - g_player[myconnectindex].ps.over_shoulder_on = 1; + g_player[myconnectindex].ps->over_shoulder_on = 1; } screenpeek = myconnectindex; @@ -413,14 +412,14 @@ int loadplayer(int spot) playmusic(&map[(unsigned char)music_select].musicfn[0]); } - g_player[myconnectindex].ps.gm = MODE_GAME; + g_player[myconnectindex].ps->gm = MODE_GAME; ud.recstat = 0; - if (g_player[myconnectindex].ps.jetpack_on) - spritesound(DUKE_JETPACK_IDLE,g_player[myconnectindex].ps.i); + if (g_player[myconnectindex].ps->jetpack_on) + spritesound(DUKE_JETPACK_IDLE,g_player[myconnectindex].ps->i); restorepalette = 1; - setpal(&g_player[myconnectindex].ps); + setpal(g_player[myconnectindex].ps); vscrn(); FX_SetReverb(0); @@ -493,8 +492,8 @@ int loadplayer(int spot) // clearbufbyte(playerquitflag,MAXPLAYERS,0x01010101); - for (i=0;i=0;i=connectpoint2[i]) - if (sprite[g_player[i].ps.i].sectnum == sect) return i; + if (sprite[g_player[i].ps->i].sectnum == sect) return i; return -1; } @@ -220,7 +220,7 @@ int findplayer(spritetype *s,long *d) if (ud.multimode < 2) { - *d = klabs(g_player[myconnectindex].ps.oposx-s->x) + klabs(g_player[myconnectindex].ps.oposy-s->y) + ((klabs(g_player[myconnectindex].ps.oposz-s->z+(28<<8)))>>4); + *d = klabs(g_player[myconnectindex].ps->oposx-s->x) + klabs(g_player[myconnectindex].ps->oposy-s->y) + ((klabs(g_player[myconnectindex].ps->oposz-s->z+(28<<8)))>>4); return myconnectindex; } @@ -229,8 +229,8 @@ int findplayer(spritetype *s,long *d) for (j=connecthead;j>=0;j=connectpoint2[j]) { - x = klabs(g_player[j].ps.oposx-s->x) + klabs(g_player[j].ps.oposy-s->y) + ((klabs(g_player[j].ps.oposz-s->z+(28<<8)))>>4); - if (x < closest && sprite[g_player[j].ps.i].extra > 0) + x = klabs(g_player[j].ps->oposx-s->x) + klabs(g_player[j].ps->oposy-s->y) + ((klabs(g_player[j].ps->oposz-s->z+(28<<8)))>>4); + if (x < closest && sprite[g_player[j].ps->i].extra > 0) { closest_player = j; closest = x; @@ -250,9 +250,9 @@ int findotherplayer(int p,long *d) closest_player = p; for (j=connecthead;j>=0;j=connectpoint2[j]) - if (p != j && sprite[g_player[j].ps.i].extra > 0) + if (p != j && sprite[g_player[j].ps->i].extra > 0) { - x = klabs(g_player[j].ps.oposx-g_player[p].ps.posx) + klabs(g_player[j].ps.oposy-g_player[p].ps.posy) + (klabs(g_player[j].ps.oposz-g_player[p].ps.posz)>>4); + x = klabs(g_player[j].ps->oposx-g_player[p].ps->posx) + klabs(g_player[j].ps->oposy-g_player[p].ps->posy) + (klabs(g_player[j].ps->oposz-g_player[p].ps->posz)>>4); if (x < closest) { @@ -306,17 +306,17 @@ void doanimations(void) if (animateptr[i] == §or[animatesect[i]].floorz) { for (p=connecthead;p>=0;p=connectpoint2[p]) - if (g_player[p].ps.cursectnum == dasect) - if ((sector[dasect].floorz-g_player[p].ps.posz) < (64<<8)) - if (sprite[g_player[p].ps.i].owner >= 0) + if (g_player[p].ps->cursectnum == dasect) + if ((sector[dasect].floorz-g_player[p].ps->posz) < (64<<8)) + if (sprite[g_player[p].ps->i].owner >= 0) { - g_player[p].ps.posz += v; - g_player[p].ps.poszv = 0; + g_player[p].ps->posz += v; + g_player[p].ps->poszv = 0; if (p == myconnectindex) { myz += v; myzvel = 0; - myzbak[((movefifoplc-1)&(MOVEFIFOSIZ-1))] = g_player[p].ps.posz; + myzbak[((movefifoplc-1)&(MOVEFIFOSIZ-1))] = g_player[p].ps->posz; } } @@ -389,10 +389,10 @@ void animatecamsprite(void) { T1 = 0; - if (g_player[screenpeek].ps.newowner >= 0) - OW = g_player[screenpeek].ps.newowner; + if (g_player[screenpeek].ps->newowner >= 0) + OW = g_player[screenpeek].ps->newowner; - else if (OW >= 0 && dist(&sprite[g_player[screenpeek].ps.i],&sprite[i]) < 2048) + else if (OW >= 0 && dist(&sprite[g_player[screenpeek].ps->i],&sprite[i]) < 2048) { if (waloff[TILE_VIEWSCR] == 0) allocatepermanenttile(TILE_VIEWSCR,tilesizx[PN],tilesizy[PN]); @@ -1033,8 +1033,8 @@ void operateactivators(int low,int snum) if (snum >= 0) { if (sector[SECT].lotag&16384) - FTA(4,&g_player[snum].ps); - else FTA(8,&g_player[snum].ps); + FTA(4,g_player[snum].ps); + else FTA(8,g_player[snum].ps); } } else @@ -1199,35 +1199,35 @@ int checkhitswitch(int snum,long w,int switchtype) break; case ACCESSSWITCH__STATIC: case ACCESSSWITCH2__STATIC: - if (g_player[snum].ps.access_incs == 0) + if (g_player[snum].ps->access_incs == 0) { if (switchpal == 0) { - if ((g_player[snum].ps.got_access&1)) - g_player[snum].ps.access_incs = 1; - else FTA(70,&g_player[snum].ps); + if ((g_player[snum].ps->got_access&1)) + g_player[snum].ps->access_incs = 1; + else FTA(70,g_player[snum].ps); } else if (switchpal == 21) { - if (g_player[snum].ps.got_access&2) - g_player[snum].ps.access_incs = 1; - else FTA(71,&g_player[snum].ps); + if (g_player[snum].ps->got_access&2) + g_player[snum].ps->access_incs = 1; + else FTA(71,g_player[snum].ps); } else if (switchpal == 23) { - if (g_player[snum].ps.got_access&4) - g_player[snum].ps.access_incs = 1; - else FTA(72,&g_player[snum].ps); + if (g_player[snum].ps->got_access&4) + g_player[snum].ps->access_incs = 1; + else FTA(72,g_player[snum].ps); } - if (g_player[snum].ps.access_incs == 1) + if (g_player[snum].ps->access_incs == 1) { if (switchtype == 0) - g_player[snum].ps.access_wallnum = w; + g_player[snum].ps->access_wallnum = w; else - g_player[snum].ps.access_spritenum = w; + g_player[snum].ps->access_spritenum = w; } return 0; @@ -1417,7 +1417,7 @@ int checkhitswitch(int snum,long w,int switchtype) if (lotag == (short) 65535) { - g_player[myconnectindex].ps.gm = MODE_EOL; + g_player[myconnectindex].ps->gm = MODE_EOL; if (ud.from_bonus) { ud.level_number = ud.from_bonus; @@ -1480,17 +1480,17 @@ int checkhitswitch(int snum,long w,int switchtype) if (picnum == ALIENSWITCH || picnum == ALIENSWITCH+1) { if (switchtype == 1) - xyzsound(ALIEN_SWITCH1,w,sx,sy,g_player[snum].ps.posz); - else xyzsound(ALIEN_SWITCH1,g_player[snum].ps.i,sx,sy,g_player[snum].ps.posz); + xyzsound(ALIEN_SWITCH1,w,sx,sy,g_player[snum].ps->posz); + else xyzsound(ALIEN_SWITCH1,g_player[snum].ps->i,sx,sy,g_player[snum].ps->posz); } else { if (switchtype == 1) - xyzsound(SWITCH_ON,w,sx,sy,g_player[snum].ps.posz); - else xyzsound(SWITCH_ON,g_player[snum].ps.i,sx,sy,g_player[snum].ps.posz); + xyzsound(SWITCH_ON,w,sx,sy,g_player[snum].ps->posz); + else xyzsound(SWITCH_ON,g_player[snum].ps->i,sx,sy,g_player[snum].ps->posz); } if (numdips != correctdips) break; - xyzsound(END_OF_LEVEL_WARN,g_player[snum].ps.i,sx,sy,g_player[snum].ps.posz); + xyzsound(END_OF_LEVEL_WARN,g_player[snum].ps->i,sx,sy,g_player[snum].ps->posz); } case DIPSWITCH2__STATIC: //case DIPSWITCH2+1: @@ -1548,11 +1548,11 @@ int checkhitswitch(int snum,long w,int switchtype) case 25: hittype[x].temp_data[4] = !hittype[x].temp_data[4]; if (hittype[x].temp_data[4]) - FTA(15,&g_player[snum].ps); - else FTA(2,&g_player[snum].ps); + FTA(15,g_player[snum].ps); + else FTA(2,g_player[snum].ps); break; case 21: - FTA(2,&g_player[screenpeek].ps); + FTA(2,g_player[screenpeek].ps); break; } } @@ -1560,7 +1560,7 @@ int checkhitswitch(int snum,long w,int switchtype) } operateactivators(lotag,snum); - operateforcefields(g_player[snum].ps.i,lotag); + operateforcefields(g_player[snum].ps->i,lotag); operatemasterswitches(lotag); if (picnum == DIPSWITCH || picnum == DIPSWITCH+1 || @@ -1570,14 +1570,14 @@ int checkhitswitch(int snum,long w,int switchtype) if (hitag == 0 && isadoorwall(picnum) == 0) { if (switchtype == 1) - xyzsound(SWITCH_ON,w,sx,sy,g_player[snum].ps.posz); - else xyzsound(SWITCH_ON,g_player[snum].ps.i,sx,sy,g_player[snum].ps.posz); + xyzsound(SWITCH_ON,w,sx,sy,g_player[snum].ps->posz); + else xyzsound(SWITCH_ON,g_player[snum].ps->i,sx,sy,g_player[snum].ps->posz); } else if (hitag != 0) { if (switchtype == 1 && (soundm[hitag]&4) == 0) - xyzsound(hitag,w,sx,sy,g_player[snum].ps.posz); - else spritesound(hitag,g_player[snum].ps.i); + xyzsound(hitag,w,sx,sy,g_player[snum].ps->posz); + else spritesound(hitag,g_player[snum].ps->i); } return 1; @@ -1705,7 +1705,7 @@ void checkhitwall(int spr,int dawallnum,long x,long y,long z,int atwith) if (wal->nextwall >= 0) wall[wal->nextwall].cstat = 0; - i = EGS(sn,x,y,z,SECTOREFFECTOR,0,0,0,g_player[0].ps.ang,0,0,spr,3); + i = EGS(sn,x,y,z,SECTOREFFECTOR,0,0,0,g_player[0].ps->ang,0,0,spr,3); SLT = 128; T2 = 5; T3 = dawallnum; @@ -1954,8 +1954,8 @@ int checkhitceiling(int sn) case TECHLIGHT2__STATIC: case TECHLIGHT4__STATIC: - ceilingglass(g_player[myconnectindex].ps.i,sn,10); - spritesound(GLASS_BREAKING,g_player[screenpeek].ps.i); + ceilingglass(g_player[myconnectindex].ps->i,sn,10); + spritesound(GLASS_BREAKING,g_player[screenpeek].ps->i); if (sector[sn].ceilingpicnum == WALLLIGHT1) sector[sn].ceilingpicnum = WALLLIGHTBUST1; @@ -2414,7 +2414,7 @@ void checkhitsprite(int i,int sn) j = sprite[sn].owner; if (j >= 0 && sprite[j].picnum == APLAYER && PN != ROTATEGUN && PN != DRONE) - if (g_player[sprite[j].yvel].ps.curr_weapon == SHOTGUN_WEAPON) + if (g_player[sprite[j].yvel].ps->curr_weapon == SHOTGUN_WEAPON) { shoot(i,BLOODSPLAT3); shoot(i,BLOODSPLAT1); @@ -2455,16 +2455,16 @@ void checkhitsprite(int i,int sn) if (sprite[i].statnum == 10) { p = sprite[i].yvel; - if (g_player[p].ps.newowner >= 0) + if (g_player[p].ps->newowner >= 0) { - g_player[p].ps.newowner = -1; - g_player[p].ps.posx = g_player[p].ps.oposx; - g_player[p].ps.posy = g_player[p].ps.oposy; - g_player[p].ps.posz = g_player[p].ps.oposz; - g_player[p].ps.ang = g_player[p].ps.oang; + g_player[p].ps->newowner = -1; + g_player[p].ps->posx = g_player[p].ps->oposx; + g_player[p].ps->posy = g_player[p].ps->oposy; + g_player[p].ps->posz = g_player[p].ps->oposz; + g_player[p].ps->ang = g_player[p].ps->oang; - updatesector(g_player[p].ps.posx,g_player[p].ps.posy,&g_player[p].ps.cursectnum); - setpal(&g_player[p].ps); + updatesector(g_player[p].ps->posx,g_player[p].ps->posy,&g_player[p].ps->cursectnum); + setpal(g_player[p].ps); j = headspritestat[1]; while (j >= 0) @@ -2517,8 +2517,8 @@ void allignwarpelevators(void) void sharedkeys(int snum) { int i, k, dainv; - unsigned long sb_snum = g_player[snum].sync.bits, j; - player_struct *p = &g_player[snum].ps; + unsigned long sb_snum = g_player[snum].sync->bits, j; + player_struct *p = g_player[snum].ps; if (p->cheat_phase == 1) return; @@ -2560,9 +2560,9 @@ void sharedkeys(int snum) if ((sb_snum&(1<<22)) && p->quick_kick == 0) if (p->curr_weapon != KNEE_WEAPON || p->kickback_pic == 0) { - SetGameVarID(g_iReturnVarID,0,g_player[snum].ps.i,snum); - OnEvent(EVENT_QUICKKICK,g_player[snum].ps.i,snum, -1); - if (GetGameVarID(g_iReturnVarID,g_player[snum].ps.i,snum) == 0) + SetGameVarID(g_iReturnVarID,0,g_player[snum].ps->i,snum); + OnEvent(EVENT_QUICKKICK,g_player[snum].ps->i,snum, -1); + if (GetGameVarID(g_iReturnVarID,g_player[snum].ps->i,snum) == 0) { p->quick_kick = 14; FTA(80,p); @@ -2602,9 +2602,9 @@ void sharedkeys(int snum) if (sb_snum&(1<<30) && p->newowner == -1) // inventory button generates event for selected item { - SetGameVarID(g_iReturnVarID,0,g_player[snum].ps.i,snum); - OnEvent(EVENT_INVENTORY,g_player[snum].ps.i,snum, -1); - if (GetGameVarID(g_iReturnVarID,g_player[snum].ps.i,snum) == 0) + SetGameVarID(g_iReturnVarID,0,g_player[snum].ps->i,snum); + OnEvent(EVENT_INVENTORY,g_player[snum].ps->i,snum, -1); + if (GetGameVarID(g_iReturnVarID,g_player[snum].ps->i,snum) == 0) { switch (p->inven_icon) { @@ -2629,9 +2629,9 @@ void sharedkeys(int snum) if (sb_snum&(1<<15)) { - SetGameVarID(g_iReturnVarID,0,g_player[snum].ps.i,snum); - OnEvent(EVENT_USENIGHTVISION,g_player[snum].ps.i,snum, -1); - if (GetGameVarID(g_iReturnVarID,g_player[snum].ps.i,snum) == 0 + SetGameVarID(g_iReturnVarID,0,g_player[snum].ps->i,snum); + OnEvent(EVENT_USENIGHTVISION,g_player[snum].ps->i,snum, -1); + if (GetGameVarID(g_iReturnVarID,g_player[snum].ps->i,snum) == 0 && p->heat_amount > 0) { p->heat_on = !p->heat_on; @@ -2644,9 +2644,9 @@ void sharedkeys(int snum) if ((sb_snum&(1<<12))) { - SetGameVarID(g_iReturnVarID,0,g_player[snum].ps.i,snum); - OnEvent(EVENT_USESTEROIDS,g_player[snum].ps.i,snum, -1); - if (GetGameVarID(g_iReturnVarID,g_player[snum].ps.i,snum) == 0) + SetGameVarID(g_iReturnVarID,0,g_player[snum].ps->i,snum); + OnEvent(EVENT_USESTEROIDS,g_player[snum].ps->i,snum, -1); + if (GetGameVarID(g_iReturnVarID,g_player[snum].ps->i,snum) == 0) { if (p->steroids_amount == 400) { @@ -2731,15 +2731,15 @@ CHECKINV1: if (sb_snum&(1<<20)) // Inventory_Left { - SetGameVarID(g_iReturnVarID,dainv,g_player[snum].ps.i,snum); - OnEvent(EVENT_INVENTORYLEFT,g_player[snum].ps.i,snum, -1); - dainv=GetGameVarID(g_iReturnVarID,g_player[snum].ps.i,snum); + SetGameVarID(g_iReturnVarID,dainv,g_player[snum].ps->i,snum); + OnEvent(EVENT_INVENTORYLEFT,g_player[snum].ps->i,snum, -1); + dainv=GetGameVarID(g_iReturnVarID,g_player[snum].ps->i,snum); } if (sb_snum&(1<<27)) // Inventory_Right { - SetGameVarID(g_iReturnVarID,dainv,g_player[snum].ps.i,snum); - OnEvent(EVENT_INVENTORYRIGHT,g_player[snum].ps.i,snum, -1); - dainv=GetGameVarID(g_iReturnVarID,g_player[snum].ps.i,snum); + SetGameVarID(g_iReturnVarID,dainv,g_player[snum].ps->i,snum); + OnEvent(EVENT_INVENTORYRIGHT,g_player[snum].ps->i,snum, -1); + dainv=GetGameVarID(g_iReturnVarID,g_player[snum].ps->i,snum); } p->inven_icon = dainv; @@ -3054,9 +3054,9 @@ CHECKINV1: if (p->holoduke_on == -1) { - SetGameVarID(g_iReturnVarID,0,g_player[snum].ps.i,snum); - OnEvent(EVENT_HOLODUKEON,g_player[snum].ps.i,snum, -1); - if (GetGameVarID(g_iReturnVarID,g_player[snum].ps.i,snum) == 0) + SetGameVarID(g_iReturnVarID,0,g_player[snum].ps->i,snum); + OnEvent(EVENT_HOLODUKEON,g_player[snum].ps->i,snum, -1); + if (GetGameVarID(g_iReturnVarID,g_player[snum].ps->i,snum) == 0) { if (p->holoduke_amount > 0) { @@ -3079,9 +3079,9 @@ CHECKINV1: } else { - SetGameVarID(g_iReturnVarID,0,g_player[snum].ps.i,snum); - OnEvent(EVENT_HOLODUKEOFF,g_player[snum].ps.i,snum, -1); - if (GetGameVarID(g_iReturnVarID,g_player[snum].ps.i,snum) == 0) + SetGameVarID(g_iReturnVarID,0,g_player[snum].ps->i,snum); + OnEvent(EVENT_HOLODUKEOFF,g_player[snum].ps->i,snum, -1); + if (GetGameVarID(g_iReturnVarID,g_player[snum].ps->i,snum) == 0) { spritesound(TELEPORTER,p->holoduke_on); p->holoduke_on = -1; @@ -3092,9 +3092,9 @@ CHECKINV1: if (sb_snum&(1<<16)) { - SetGameVarID(g_iReturnVarID,0,g_player[snum].ps.i,snum); - OnEvent(EVENT_USEMEDKIT,g_player[snum].ps.i,snum, -1); - if (GetGameVarID(g_iReturnVarID,g_player[snum].ps.i,snum) == 0) + SetGameVarID(g_iReturnVarID,0,g_player[snum].ps->i,snum); + OnEvent(EVENT_USEMEDKIT,g_player[snum].ps->i,snum, -1); + if (GetGameVarID(g_iReturnVarID,g_player[snum].ps->i,snum) == 0) { if (p->firstaid_amount > 0 && sprite[p->i].extra < max_player_health) { @@ -3119,9 +3119,9 @@ CHECKINV1: if (sb_snum&(1<<25) && p->newowner == -1) { - SetGameVarID(g_iReturnVarID,0,g_player[snum].ps.i,snum); - OnEvent(EVENT_USEJETPACK,g_player[snum].ps.i,snum, -1); - if (GetGameVarID(g_iReturnVarID,g_player[snum].ps.i,snum) == 0) + SetGameVarID(g_iReturnVarID,0,g_player[snum].ps->i,snum); + OnEvent(EVENT_USEJETPACK,g_player[snum].ps->i,snum, -1); + if (GetGameVarID(g_iReturnVarID,g_player[snum].ps->i,snum) == 0) { if (p->jetpack_amount > 0) { @@ -3204,7 +3204,7 @@ static long hitawall(player_struct *p,short *hitw) void checksectors(int snum) { long i = -1,oldz; - player_struct *p = &g_player[snum].ps; + player_struct *p = g_player[snum].ps; short j,hitscanwall; switch (sector[p->cursectnum].lotag) @@ -3217,7 +3217,7 @@ void checksectors(int snum) return; case -1: for (i=connecthead;i>=0;i=connectpoint2[i]) - g_player[i].ps.gm = MODE_EOL; + g_player[i].ps->gm = MODE_EOL; sector[p->cursectnum].lotag = 0; if (ud.from_bonus) { @@ -3253,33 +3253,33 @@ void checksectors(int snum) if (p->gm&MODE_TYPE || sprite[p->i].extra <= 0) return; - if ((g_player[snum].sync.bits&(1<<29))) + if ((g_player[snum].sync->bits&(1<<29))) { SetGameVarID(g_iReturnVarID,0,p->i,snum); OnEvent(EVENT_USE, p->i, snum, -1); if (GetGameVarID(g_iReturnVarID,p->i,snum) != 0) - g_player[snum].sync.bits &= ~(1<<29); + g_player[snum].sync->bits &= ~(1<<29); } - if (ud.cashman && g_player[snum].sync.bits&(1<<29)) + if (ud.cashman && g_player[snum].sync->bits&(1<<29)) lotsofmoney(p->i,2); if (p->newowner >= 0) { - if (klabs(g_player[snum].sync.svel) > 768 || klabs(g_player[snum].sync.fvel) > 768) + if (klabs(g_player[snum].sync->svel) > 768 || klabs(g_player[snum].sync->fvel) > 768) { i = -1; goto CLEARCAMERAS; } } - if (!(g_player[snum].sync.bits&(1<<29)) && !(g_player[snum].sync.bits&(1<<31))) + if (!(g_player[snum].sync->bits&(1<<29)) && !(g_player[snum].sync->bits&(1<<31))) p->toggle_key_flag = 0; else if (!p->toggle_key_flag) { - if ((g_player[snum].sync.bits&(1<<31))) + if ((g_player[snum].sync->bits&(1<<31))) { if (p->newowner >= 0) { @@ -3498,7 +3498,7 @@ CLEARCAMERAS: } } - if ((g_player[snum].sync.bits&(1<<29)) == 0) return; + if ((g_player[snum].sync->bits&(1<<29)) == 0) return; else if (p->newowner >= 0) { i = -1; diff --git a/polymer/eduke32/source/sounds.c b/polymer/eduke32/source/sounds.c index a42cf76cc..b299c2b25 100644 --- a/polymer/eduke32/source/sounds.c +++ b/polymer/eduke32/source/sounds.c @@ -237,7 +237,7 @@ int loadsound(unsigned int num) if (fp == -1) { // Bsprintf(fta_quotes[113],"Sound %s(#%d) not found.",sounds[num],num); -// FTA(113,&g_player[myconnectindex].ps); +// FTA(113,g_player[myconnectindex].ps); initprintf("Sound %s(#%d) not found.\n",sounds[num],num); return 0; } @@ -267,8 +267,8 @@ int xyzsound(int num,int i,long x,long y,long z) ud.config.SoundToggle == 0 || Sound[num].num > 3 || FX_VoiceAvailable(soundpr[num]) == 0 || - (g_player[myconnectindex].ps.timebeforeexit > 0 && g_player[myconnectindex].ps.timebeforeexit <= 26*3) || - g_player[myconnectindex].ps.gm&MODE_MENU) return -1; + (g_player[myconnectindex].ps->timebeforeexit > 0 && g_player[myconnectindex].ps->timebeforeexit <= 26*3) || + g_player[myconnectindex].ps->gm&MODE_MENU) return -1; if (soundm[num]&128) { @@ -288,11 +288,11 @@ int xyzsound(int num,int i,long x,long y,long z) return -1; } - cx = g_player[screenpeek].ps.oposx; - cy = g_player[screenpeek].ps.oposy; - cz = g_player[screenpeek].ps.oposz; - cs = g_player[screenpeek].ps.cursectnum; - ca = g_player[screenpeek].ps.ang+g_player[screenpeek].ps.look_ang; + cx = g_player[screenpeek].ps->oposx; + cy = g_player[screenpeek].ps->oposy; + cz = g_player[screenpeek].ps->oposz; + cs = g_player[screenpeek].ps->cursectnum; + ca = g_player[screenpeek].ps->ang+g_player[screenpeek].ps->look_ang; sndist = FindDistance3D((cx-x),(cy-y),(cz-z)>>4); @@ -323,18 +323,18 @@ int xyzsound(int num,int i,long x,long y,long z) case RPG_EXPLODE: if (sndist > (6144)) sndist = 6144; - if (sector[g_player[screenpeek].ps.cursectnum].lotag == 2) + if (sector[g_player[screenpeek].ps->cursectnum].lotag == 2) pitch -= 1024; break; default: - if (sector[g_player[screenpeek].ps.cursectnum].lotag == 2 && (soundm[num]&4) == 0) + if (sector[g_player[screenpeek].ps->cursectnum].lotag == 2 && (soundm[num]&4) == 0) pitch = -768; if (sndist > 31444 && PN != MUSICANDSFX) return -1; break; } - if (g_player[screenpeek].ps.sound_pitch) pitch += g_player[screenpeek].ps.sound_pitch; + if (g_player[screenpeek].ps->sound_pitch) pitch += g_player[screenpeek].ps->sound_pitch; if (Sound[num].num > 0 && PN != MUSICANDSFX) { @@ -515,11 +515,11 @@ void pan3dsound(void) if (ud.camerasprite == -1) { - cx = g_player[screenpeek].ps.oposx; - cy = g_player[screenpeek].ps.oposy; - cz = g_player[screenpeek].ps.oposz; - cs = g_player[screenpeek].ps.cursectnum; - ca = g_player[screenpeek].ps.ang+g_player[screenpeek].ps.look_ang; + cx = g_player[screenpeek].ps->oposx; + cy = g_player[screenpeek].ps->oposy; + cz = g_player[screenpeek].ps->oposz; + cs = g_player[screenpeek].ps->cursectnum; + ca = g_player[screenpeek].ps->ang+g_player[screenpeek].ps->look_ang; } else { diff --git a/polymer/eduke32/source/startgtk.game.c b/polymer/eduke32/source/startgtk.game.c index 0d0472093..2d1a3679d 100755 --- a/polymer/eduke32/source/startgtk.game.c +++ b/polymer/eduke32/source/startgtk.game.c @@ -748,7 +748,7 @@ int startwin_run(void) settings.xdim3d = ud.config.ScreenWidth; settings.ydim3d = ud.config.ScreenHeight; settings.bpp3d = ud.config.ScreenBPP; - settings.forcesetup = ud.config.ForceSetup; + settings.forcesetup = ud.config.ForceSetup; settings.usemouse = ud.config.UseMouse; settings.usejoy = ud.config.UseJoystick; settings.game = g_GameType;