From 685d0443c58a61b0a162d4f448ff886bf6fe6bb8 Mon Sep 17 00:00:00 2001 From: Yamagi Burmeister Date: Sun, 5 Nov 2017 14:00:50 +0100 Subject: [PATCH] A lot of source code fixes. This is enough that the code builds without too many scary warnings on modern compilers, the game.so loads on Linux and working bots are spawning in. Windows support is comming in a later commit. --- src/bot.h | 2 +- src/bot_fire.c | 74 ++++++++++++++++++++++++-------------------------- src/bot_func.c | 7 ++--- src/bot_za.c | 20 +++++++------- src/g_ctf.c | 27 ++++++++++-------- src/g_ctf.h | 4 +-- src/g_func.c | 2 +- src/g_main.c | 4 +-- src/g_save.c | 2 ++ src/g_spawn.c | 2 ++ src/g_target.c | 4 +-- src/g_utils.c | 2 +- src/g_weapon.c | 2 +- src/p_client.c | 34 +++++++++++------------ src/p_weapon.c | 3 +- 15 files changed, 95 insertions(+), 94 deletions(-) diff --git a/src/bot.h b/src/bot.h index 9896c8c..9e90e26 100644 --- a/src/bot.h +++ b/src/bot.h @@ -426,4 +426,4 @@ extern gitem_t *Fdi_SLUGS; extern gitem_t *Fdi_MAGSLUGS; extern float ctfjob_update; -#endif \ No newline at end of file +#endif diff --git a/src/bot_fire.c b/src/bot_fire.c index f8c7f5f..4f9079c 100644 --- a/src/bot_fire.c +++ b/src/bot_fire.c @@ -471,12 +471,12 @@ qboolean B_UseBfg(edict_t *ent,edict_t *target,int enewep,float aim,float distan client = ent->client; zc = &client->zc; - if(k = CanUsewep(ent,WEAP_BFG)) + if(CanUsewep(ent,WEAP_BFG)) { mywep = Get_KindWeapon(client->pers.weapon); Get_AimAngle(ent,aim,distance,mywep); if(trace_priority < TRP_ANGLEKEEP) trace_priority = TRP_ANGLEKEEP; - if(k = Bot_traceS(ent,target)) VectorCopy(target->s.origin,zc->vtemp); + if((k = Bot_traceS(ent,target))) VectorCopy(target->s.origin,zc->vtemp); if(FFlg[skill] & FIRE_STAYFIRE) { @@ -535,14 +535,14 @@ qboolean B_UseBfg(edict_t *ent,edict_t *target,int enewep,float aim,float distan //------------------------------------------------------------ qboolean B_UseHyperBlaster(edict_t *ent,edict_t *target,int enewep,float aim,float distance,int skill) { - int k,mywep; + int mywep; zgcl_t *zc; gclient_t *client; client = ent->client; zc = &client->zc; - if(k = CanUsewep(ent,WEAP_HYPERBLASTER)) + if(CanUsewep(ent,WEAP_HYPERBLASTER)) { mywep = Get_KindWeapon(client->pers.weapon); Get_AimAngle(ent,aim,distance,mywep); @@ -560,14 +560,14 @@ qboolean B_UseHyperBlaster(edict_t *ent,edict_t *target,int enewep,float aim,flo //------------------------------------------------------------ qboolean B_UsePhalanx(edict_t *ent,edict_t *target,int enewep,float aim,float distance,int skill) { - int k,mywep; + int mywep; zgcl_t *zc; gclient_t *client; client = ent->client; zc = &client->zc; - if(k = CanUsewep(ent,WEAP_PHALANX)) + if(CanUsewep(ent,WEAP_PHALANX)) { mywep = Get_KindWeapon(client->pers.weapon); Get_AimAngle(ent,aim,distance,mywep); @@ -589,7 +589,7 @@ qboolean B_UsePhalanx(edict_t *ent,edict_t *target,int enewep,float aim,float di && (target->s.origin[2] - ent->s.origin[2]) < JumpMax && !(client->ps.pmove.pm_flags && PMF_DUCKED)) { - if(ent->groundentity && !ent->waterlevel <= 1) + if(ent->groundentity && !(ent->waterlevel <= 1)) { if(zc->route_trace) { @@ -639,14 +639,14 @@ qboolean B_UsePhalanx(edict_t *ent,edict_t *target,int enewep,float aim,float di //------------------------------------------------------------ qboolean B_UseRocket(edict_t *ent,edict_t *target,int enewep,float aim,float distance,int skill) { - int k,mywep; + int mywep; zgcl_t *zc; gclient_t *client; client = ent->client; zc = &client->zc; - if(k = CanUsewep(ent,WEAP_ROCKETLAUNCHER)) + if(CanUsewep(ent,WEAP_ROCKETLAUNCHER)) { mywep = Get_KindWeapon(client->pers.weapon); Get_AimAngle(ent,aim,distance,mywep); @@ -668,7 +668,7 @@ qboolean B_UseRocket(edict_t *ent,edict_t *target,int enewep,float aim,float dis && (target->s.origin[2] - ent->s.origin[2]) < JumpMax && !(client->ps.pmove.pm_flags && PMF_DUCKED)) { - if(ent->groundentity && !ent->waterlevel <= 1) + if(ent->groundentity && !(ent->waterlevel <= 1)) { if(zc->route_trace) { @@ -720,14 +720,14 @@ qboolean B_UseRocket(edict_t *ent,edict_t *target,int enewep,float aim,float dis //------------------------------------------------------------ qboolean B_UseBoomer(edict_t *ent,edict_t *target,int enewep,float aim,float distance,int skill) { - int k,mywep; + int mywep; zgcl_t *zc; gclient_t *client; client = ent->client; zc = &client->zc; - if(k = CanUsewep(ent,WEAP_BOOMER)) + if(CanUsewep(ent,WEAP_BOOMER)) { mywep = Get_KindWeapon(client->pers.weapon); Get_AimAngle(ent,aim,distance,mywep); @@ -745,14 +745,14 @@ qboolean B_UseBoomer(edict_t *ent,edict_t *target,int enewep,float aim,float dis //------------------------------------------------------------ qboolean B_UseRailgun(edict_t *ent,edict_t *target,int enewep,float aim,float distance,int skill) { - int k,mywep; + int mywep; zgcl_t *zc; gclient_t *client; client = ent->client; zc = &client->zc; - if(k = CanUsewep(ent,WEAP_RAILGUN)) + if(CanUsewep(ent,WEAP_RAILGUN)) { mywep = Get_KindWeapon(client->pers.weapon); Get_AimAngle(ent,aim,distance,mywep); @@ -770,14 +770,14 @@ qboolean B_UseRailgun(edict_t *ent,edict_t *target,int enewep,float aim,float di //------------------------------------------------------------ qboolean B_UseGrenadeLauncher(edict_t *ent,edict_t *target,int enewep,float aim,float distance,int skill) { - int k,mywep; + int mywep; zgcl_t *zc; gclient_t *client; client = ent->client; zc = &client->zc; - if(k = CanUsewep(ent,WEAP_GRENADELAUNCHER)) + if(CanUsewep(ent,WEAP_GRENADELAUNCHER)) { mywep = Get_KindWeapon(client->pers.weapon); Get_AimAngle(ent,aim,distance,mywep); @@ -823,14 +823,14 @@ qboolean B_UseGrenadeLauncher(edict_t *ent,edict_t *target,int enewep,float aim, //------------------------------------------------------------ qboolean B_UseChainGun(edict_t *ent,edict_t *target,int enewep,float aim,float distance,int skill) { - int k,mywep; + int mywep; zgcl_t *zc; gclient_t *client; client = ent->client; zc = &client->zc; - if(k = CanUsewep(ent,WEAP_CHAINGUN)) + if(CanUsewep(ent,WEAP_CHAINGUN)) { mywep = Get_KindWeapon(client->pers.weapon); Get_AimAngle(ent,aim,distance,mywep); @@ -856,7 +856,7 @@ qboolean B_UseMachineGun(edict_t *ent,edict_t *target,int enewep,float aim,float client = ent->client; zc = &client->zc; - if(k = CanUsewep(ent,WEAP_MACHINEGUN)) + if((k = CanUsewep(ent,WEAP_MACHINEGUN))) { mywep = Get_KindWeapon(client->pers.weapon); Get_AimAngle(ent,aim,distance,mywep); @@ -874,14 +874,14 @@ qboolean B_UseMachineGun(edict_t *ent,edict_t *target,int enewep,float aim,float //------------------------------------------------------------ qboolean B_UseSuperShotgun(edict_t *ent,edict_t *target,int enewep,float aim,float distance,int skill) { - int k,mywep; + int mywep; zgcl_t *zc; gclient_t *client; client = ent->client; zc = &client->zc; - if(k = CanUsewep(ent,WEAP_SUPERSHOTGUN)) + if(CanUsewep(ent,WEAP_SUPERSHOTGUN)) { mywep = Get_KindWeapon(client->pers.weapon); Get_AimAngle(ent,aim,distance,mywep); @@ -899,14 +899,14 @@ qboolean B_UseSuperShotgun(edict_t *ent,edict_t *target,int enewep,float aim,flo //------------------------------------------------------------ qboolean B_UseShotgun(edict_t *ent,edict_t *target,int enewep,float aim,float distance,int skill) { - int k,mywep; + int mywep; zgcl_t *zc; gclient_t *client; client = ent->client; zc = &client->zc; - if(k = CanUsewep(ent,WEAP_SHOTGUN)) + if(CanUsewep(ent,WEAP_SHOTGUN)) { mywep = Get_KindWeapon(client->pers.weapon); Get_AimAngle(ent,aim,distance,mywep); @@ -924,14 +924,14 @@ qboolean B_UseShotgun(edict_t *ent,edict_t *target,int enewep,float aim,float di //------------------------------------------------------------ qboolean B_UseHandGrenade(edict_t *ent,edict_t *target,int enewep,float aim,float distance,int skill) { - int k,mywep; + int mywep; zgcl_t *zc; gclient_t *client; client = ent->client; zc = &client->zc; - if(k = CanUsewep(ent,WEAP_GRENADES)) + if(CanUsewep(ent,WEAP_GRENADES)) { mywep = Get_KindWeapon(client->pers.weapon); Get_AimAngle(ent,aim,distance,mywep); @@ -949,14 +949,14 @@ qboolean B_UseHandGrenade(edict_t *ent,edict_t *target,int enewep,float aim,floa //------------------------------------------------------------ qboolean B_UseTrap(edict_t *ent,edict_t *target,int enewep,float aim,float distance,int skill) { - int k,mywep; + int mywep; zgcl_t *zc; gclient_t *client; client = ent->client; zc = &client->zc; - if(k = CanUsewep(ent,WEAP_TRAP)) + if(CanUsewep(ent,WEAP_TRAP)) { mywep = Get_KindWeapon(client->pers.weapon); Get_AimAngle(ent,aim,distance,mywep); @@ -975,14 +975,14 @@ qboolean B_UseTrap(edict_t *ent,edict_t *target,int enewep,float aim,float dista //------------------------------------------------------------ qboolean B_UseBlaster(edict_t *ent,edict_t *target,int enewep,float aim,float distance,int skill) { - int k,mywep; + int mywep; zgcl_t *zc; gclient_t *client; client = ent->client; zc = &client->zc; - if(k = CanUsewep(ent,WEAP_BLASTER)) + if(CanUsewep(ent,WEAP_BLASTER)) { mywep = Get_KindWeapon(client->pers.weapon); Get_AimAngle(ent,aim,distance,mywep); @@ -1002,7 +1002,6 @@ void Combat_LevelX(edict_t *ent,int foundedenemy,int enewep edict_t *target; int mywep,k; vec3_t v; - qboolean mod = false; client = ent->client; zc = &client->zc; @@ -1067,7 +1066,6 @@ void Combat_Level0(edict_t *ent,int foundedenemy,int enewep edict_t *target; int mywep,i,j,k; vec3_t v,vv,v1,v2; - qboolean mod = false; trace_t rs_trace; @@ -1318,7 +1316,7 @@ void Combat_Level0(edict_t *ent,int foundedenemy,int enewep && (zc->zcstate & STS_WAITSMASK2) && (target->s.origin[2] - ent->s.origin[2]) < -300) { - if(k = CanUsewep(ent,WEAP_GRENADELAUNCHER)) + if(CanUsewep(ent,WEAP_GRENADELAUNCHER)) { mywep = Get_KindWeapon(client->pers.weapon); Get_AimAngle(ent,aim,distance,mywep); @@ -1327,7 +1325,7 @@ void Combat_Level0(edict_t *ent,int foundedenemy,int enewep trace_priority = TRP_ANGLEKEEP; return; } - if(k = CanUsewep(ent,WEAP_GRENADES)) + if(CanUsewep(ent,WEAP_GRENADES)) { mywep = Get_KindWeapon(client->pers.weapon); Get_AimAngle(ent,aim,distance,mywep); @@ -1412,7 +1410,7 @@ void Combat_Level0(edict_t *ent,int foundedenemy,int enewep if(enewep < WEAP_MACHINEGUN || enewep == WEAP_GRENADES) j = true; //Hyper Blaster - if(k = CanUsewep(ent,WEAP_HYPERBLASTER)) + if(CanUsewep(ent,WEAP_HYPERBLASTER)) { mywep = Get_KindWeapon(client->pers.weapon); Get_AimAngle(ent,aim,distance,mywep); @@ -1426,7 +1424,7 @@ void Combat_Level0(edict_t *ent,int foundedenemy,int enewep return; } //Chain Gun - if(k = CanUsewep(ent,WEAP_CHAINGUN)) + if(CanUsewep(ent,WEAP_CHAINGUN)) { mywep = Get_KindWeapon(client->pers.weapon); Get_AimAngle(ent,aim,distance,mywep); @@ -1440,7 +1438,7 @@ void Combat_Level0(edict_t *ent,int foundedenemy,int enewep return; } //Machine Gun - if(k = CanUsewep(ent,WEAP_MACHINEGUN)) + if(CanUsewep(ent,WEAP_MACHINEGUN)) { mywep = Get_KindWeapon(client->pers.weapon); Get_AimAngle(ent,aim,distance,mywep); @@ -1454,7 +1452,7 @@ void Combat_Level0(edict_t *ent,int foundedenemy,int enewep return; } //S-Shotgun - if(k = CanUsewep(ent,WEAP_SUPERSHOTGUN)) + if(CanUsewep(ent,WEAP_SUPERSHOTGUN)) { mywep = Get_KindWeapon(client->pers.weapon); Get_AimAngle(ent,aim,distance,mywep); @@ -1797,8 +1795,6 @@ FIRED: void UsePrimaryWeapon(edict_t *ent) { - int mywep = Get_KindWeapon(ent->client->pers.weapon); - if(CanUsewep(ent,WEAP_BFG)) return; CanUsewep(ent,Bot[ent->client->zc.botindex].param[BOP_PRIWEP]); diff --git a/src/bot_func.c b/src/bot_func.c index 46a352a..1aafd19 100644 --- a/src/bot_func.c +++ b/src/bot_func.c @@ -98,7 +98,7 @@ void Load_BotInfo() while(1) { if(fgets( Buff, sizeof(Buff), fp ) == NULL) goto MESS_NOTFOUND; - if(!_strnicmp(MessageSection,Buff,strlen(MessageSection))) break; + if(!strncasecmp(MessageSection,Buff,strlen(MessageSection))) break; } while(1) @@ -121,7 +121,7 @@ MESS_NOTFOUND: MessageSection[0] = 0; break; } - if(!_strnicmp(MessageSection,Buff,strlen(MessageSection))) break; + if(!strncasecmp(MessageSection,Buff,strlen(MessageSection))) break; } //when not found if(MessageSection[0] == 0) @@ -131,7 +131,7 @@ MESS_NOTFOUND: while(1) { if(fgets( Buff, sizeof(Buff), fp ) == NULL) goto BOTLIST_NOTFOUND; - if(!_strnicmp(MessageSection,Buff,strlen(MessageSection))) break; + if(!strncasecmp(MessageSection,Buff,strlen(MessageSection))) break; } } @@ -336,7 +336,6 @@ void InitializeBot (edict_t *ent,int botindex ) gclient_t *client; char pinfo[200]; int index; - int i; index = ent-g_edicts-1; ent->client = &game.clients[index]; diff --git a/src/bot_za.c b/src/bot_za.c index e15c400..5429749 100644 --- a/src/bot_za.c +++ b/src/bot_za.c @@ -1011,7 +1011,7 @@ int Bot_moveT ( edict_t *ent,float ryaw,vec3_t pos,float dist,float *bottom) else VectorSet (vv,16,16,3); if(0/*!(ent->client->ps.pmove.pm_flags & PMF_DUCKED) - && (ent->client->zc.n_duckedtime < FRAMETIME * 10 /*&& !ent->client->zc.route_trace)*/) trmax[2] = 31; + && (ent->client->zc.n_duckedtime < FRAMETIME * 10 && !ent->client->zc.route_trace)*/) trmax[2] = 31; // else if(ent->waterlevel && !ent->groundentity) trmax[2] = 32; else if(ent->client->zc.route_trace && !(ent->client->ps.pmove.pm_flags & PMF_DUCKED) @@ -2287,7 +2287,7 @@ void Bots_Move_NORM (edict_t *ent) gitem_t *item; float x,yaw,iyaw,f1,f2,f3,bottom; - qboolean tempflag;//,buttonuse; + int tempflag;//,buttonuse; vec3_t temppos; trace_t rs_trace; @@ -2433,15 +2433,15 @@ if(ctf->value) j = 0; else if(!ctf->value && Route[i].ent->solid == SOLID_TRIGGER) { //Quad - if(j = mpindex[MPI_QUAD]) + if((j = mpindex[MPI_QUAD])) if(Route[i].ent->item == &itemlist[j]) {zc->havetarget = true; break;} //Quad fire - if(j = mpindex[MPI_QUADF]) + if((j = mpindex[MPI_QUADF])) if(Route[i].ent->item == &itemlist[j]) {zc->havetarget = true; break;} //Quad fire - if(j = mpindex[MPI_PENTA]) + if((j = mpindex[MPI_PENTA])) if(Route[i].ent->item == &itemlist[j]) {zc->havetarget = true; break;} } @@ -3814,7 +3814,7 @@ gi.bprintf(PRINT_HIGH,"OFF 10\n"); // else if(zc->waterstate == WAS_IN) k = true; if(ent->groundentity /*|| ent->waterlevel ) && - /*temppos[2] < 32 || zc->waterstate != WAS_IN)*/ || ent->waterlevel/*zc->waterstate*/ ) + temppos[2] < 32 || zc->waterstate != WAS_IN)*/ || ent->waterlevel/*zc->waterstate*/ ) { k = false; yaw = temppos[2]; @@ -4881,7 +4881,7 @@ GOMOVE: //right trace yaw = zc->moveyaw + x; if(yaw > 180) yaw -= 360; - if(j = Bot_moveT (ent,yaw,temppos,dist,&bottom)) + if((j = Bot_moveT (ent,yaw,temppos,dist,&bottom))) { //special if(x == 0 && /*bottom < 20 &&*/ !ent->waterlevel @@ -4992,7 +4992,7 @@ GOMOVE: else if(bottom <= f3 &&(bottom >= f1 || /*zc->waterstate*/ent->waterlevel /* 2*/)) { // ent->client->anim_priority = ANIM_BASIC; - if(bottom < 0 && !zc->waterstate/*(ent->waterlevel && !zc->waterstate/*ent->waterlevel < 2)*/) + if(bottom < 0 && !zc->waterstate/*(ent->waterlevel && !zc->waterstate ent->waterlevel < 2)*/) { f2 = FRAMETIME * (ent->velocity[2] - ent->gravity * sv_gravity->value * FRAMETIME); if(bottom >= f2 && ent->velocity[2] < 0/*20*/) temppos[2] += bottom; @@ -5055,7 +5055,7 @@ GOMOVE: //left trace yaw = zc->moveyaw - x; if(yaw < -180) yaw += 360; - if(j = Bot_moveT (ent,yaw,temppos,dist,&bottom)) + if((j = Bot_moveT (ent,yaw,temppos,dist,&bottom))) { if(zc->waterstate == WAS_FLOAT) f2 = TOP_LIMIT_WATER; else f2 = JumpMax; @@ -5093,7 +5093,7 @@ GOMOVE: else if(bottom <= f3 && (bottom >= f1 || ent->waterlevel /* 2zc->waterstate*/)) { //ent->client->anim_priority = ANIM_BASIC; - if(bottom < 0 && !zc->waterstate/*(ent->waterlevel && !zc->waterstate/*ent->waterlevel < 2)*/) + if(bottom < 0 && !zc->waterstate/*(ent->waterlevel && !zc->waterstate ent->waterlevel < 2)*/) { //gi.bprintf(PRINT_HIGH,"ponko\n"); f2 = FRAMETIME * (ent->velocity[2] - ent->gravity * sv_gravity->value * FRAMETIME); diff --git a/src/g_ctf.c b/src/g_ctf.c index c1d2260..ff334c0 100644 --- a/src/g_ctf.c +++ b/src/g_ctf.c @@ -352,7 +352,7 @@ void CTFAssignTeam(gclient_t *who) team2count++; } } - if (team1count < team1count) + if (team1count < team2count) who->resp.ctf_team = CTF_TEAM1; else if (team2count < team1count) who->resp.ctf_team = CTF_TEAM2; @@ -379,10 +379,16 @@ edict_t *SelectCTFSpawnPoint (edict_t *ent) char *cname; if (ent->client->resp.ctf_state != CTF_STATE_START) + { if ( (int)(dmflags->value) & DF_SPAWN_FARTHEST) - return SelectFarthestDeathmatchSpawnPoint (); + { + return SelectFarthestDeathmatchSpawnPoint(); + } else - return SelectRandomDeathmatchSpawnPoint (); + { + return SelectRandomDeathmatchSpawnPoint(); + } + } ent->client->resp.ctf_state = CTF_STATE_PLAYING; @@ -807,21 +813,20 @@ void CTFDeadDropFlag(edict_t *self) } } -qboolean CTFDrop_Flag(edict_t *ent, gitem_t *item) +void +CTFDrop_Flag(edict_t *ent, gitem_t *item) { - if (rand() & 1) + if (rand() & 1) { - if(!(ent->svflags & SVF_MONSTER)) gi.cprintf(ent, PRINT_HIGH, "Only lusers drop flags.\n"); } else { - if(!(ent->svflags & SVF_MONSTER)) gi.cprintf(ent, PRINT_HIGH, "Winners don't drop flags.\n"); } - return false; } + static void CTFFlagThink(edict_t *ent) { if (ent->solid != SOLID_NOT) @@ -2771,10 +2776,10 @@ int CTFUpdateJoinMenu(edict_t *ent) joinmenu[6].SelectFunc = CTFJoinTeam2; if (ctf_forcejoin->string && *ctf_forcejoin->string) { - if (stricmp(ctf_forcejoin->string, "red") == 0) { + if (Q_stricmp(ctf_forcejoin->string, "red") == 0) { joinmenu[6].text = NULL; joinmenu[6].SelectFunc = NULL; - } else if (stricmp(ctf_forcejoin->string, "blue") == 0) { + } else if (Q_stricmp(ctf_forcejoin->string, "blue") == 0) { joinmenu[4].text = NULL; joinmenu[4].SelectFunc = NULL; } @@ -3224,4 +3229,4 @@ void CTFJobAssign (void) if(geti2 != NULL) geti2->client->zc.ctfstate = CTFS_OFFENCER; } /// gi.bprintf(PRINT_HIGH,"Called!!!!\n"); -} \ No newline at end of file +} diff --git a/src/g_ctf.h b/src/g_ctf.h index 9400969..f6e2aa9 100644 --- a/src/g_ctf.h +++ b/src/g_ctf.h @@ -82,7 +82,7 @@ void CTFAssignSkin(edict_t *ent, char *s); void CTFAssignTeam(gclient_t *who); edict_t *SelectCTFSpawnPoint (edict_t *ent); qboolean CTFPickup_Flag(edict_t *ent, edict_t *other); -qboolean CTFDrop_Flag(edict_t *ent, gitem_t *item); +void CTFDrop_Flag(edict_t *ent, gitem_t *item); void CTFEffects(edict_t *player); void CTFCalcScores(void); void SetCTFStats(edict_t *ent); @@ -133,4 +133,4 @@ void ChasePrev(edict_t *ent); void SP_trigger_teleport (edict_t *ent); void SP_info_teleport_destination (edict_t *ent); -#endif \ No newline at end of file +#endif diff --git a/src/g_func.c b/src/g_func.c index 8b49645..5bca914 100644 --- a/src/g_func.c +++ b/src/g_func.c @@ -2098,7 +2098,7 @@ void door_secret_done (edict_t *self) void door_secret_blocked (edict_t *self, edict_t *other) { - if (!(other->svflags & SVF_MONSTER) && (!other->client) || !Q_stricmp(other->classname,"bodyque")) + if ((!(other->svflags & SVF_MONSTER) && (!other->client)) || !Q_stricmp(other->classname,"bodyque")) { // give it a chance to go away on it's own terms (like gibs) T_Damage (other, self, self, vec3_origin, other->s.origin, vec3_origin, 100000, 1, 0, MOD_CRUSH); diff --git a/src/g_main.c b/src/g_main.c index 0c483d9..2d75367 100644 --- a/src/g_main.c +++ b/src/g_main.c @@ -321,7 +321,7 @@ void EndDMLevel (void) ent->classname = "target_changelevel"; ent->map = level.mapname; } - else if (level.nextmap) + else if (level.nextmap[0]) { // go to a specific map ent = G_Spawn (); ent->classname = "target_changelevel"; @@ -473,13 +473,11 @@ void G_InitEdict (edict_t *e); void G_RunFrame (void) { int i,j; - static int ofs; static float next_fragadd = 0; edict_t *ent; vec3_t v,vv; qboolean haveflag; - gitem_t *item; level.framenum++; level.time = level.framenum*FRAMETIME; diff --git a/src/g_save.c b/src/g_save.c index 2e09ac9..b81fc72 100644 --- a/src/g_save.c +++ b/src/g_save.c @@ -296,6 +296,8 @@ void WriteField2 (FILE *f, field_t *field, byte *base) fwrite (*(char **)p, len, 1, f); } break; + default: + break; } } diff --git a/src/g_spawn.c b/src/g_spawn.c index 1cf98e9..3950113 100644 --- a/src/g_spawn.c +++ b/src/g_spawn.c @@ -450,6 +450,8 @@ void ED_ParseField (char *key, char *value, edict_t *ent) break; case F_IGNORE: break; + default: + break; } return; } diff --git a/src/g_target.c b/src/g_target.c index 3873d88..29f5a8c 100644 --- a/src/g_target.c +++ b/src/g_target.c @@ -157,7 +157,7 @@ void SP_target_secret (edict_t *ent) ent->svflags = SVF_NOCLIENT; level.total_secrets++; // map bug hack - if (!stricmp(level.mapname, "mine3") && ent->s.origin[0] == 280 && ent->s.origin[1] == -2048 && ent->s.origin[2] == -624) + if (!Q_stricmp(level.mapname, "mine3") && ent->s.origin[0] == 280 && ent->s.origin[1] == -2048 && ent->s.origin[2] == -624) ent->message = "You have found a secret area."; } @@ -290,7 +290,7 @@ void SP_target_changelevel (edict_t *ent) } // ugly hack because *SOMEBODY* screwed up their map - if((stricmp(level.mapname, "fact1") == 0) && (stricmp(ent->map, "fact3") == 0)) + if((Q_stricmp(level.mapname, "fact1") == 0) && (Q_stricmp(ent->map, "fact3") == 0)) ent->map = "fact3$secret1"; ent->use = use_target_changelevel; diff --git a/src/g_utils.c b/src/g_utils.c index c719b7d..23aa4bd 100644 --- a/src/g_utils.c +++ b/src/g_utils.c @@ -509,7 +509,7 @@ void G_TouchTriggers (edict_t *ent) // be careful, it is possible to have an entity in this // list removed before we get to it (killtriggered) -/* for (i=0 ; iinuse) diff --git a/src/g_weapon.c b/src/g_weapon.c index e06fc95..6893a2f 100644 --- a/src/g_weapon.c +++ b/src/g_weapon.c @@ -1238,7 +1238,7 @@ void heat_think (edict_t *self) continue; // if we need to reduce the tracking cone - /* + { vec3_t vec; float dot; diff --git a/src/p_client.c b/src/p_client.c index 7c174f4..aeb82b9 100644 --- a/src/p_client.c +++ b/src/p_client.c @@ -37,7 +37,7 @@ static void SP_FixCoopSpots (edict_t *self) VectorSubtract(self->s.origin, spot->s.origin, d); if (VectorLength(d) < 384) { - if ((!self->targetname) || stricmp(self->targetname, spot->targetname) != 0) + if ((!self->targetname) || Q_stricmp(self->targetname, spot->targetname) != 0) { // gi.dprintf("FixCoopSpots changed %s at %s targetname from %s to %s\n", self->classname, vtos(self->s.origin), self->targetname, spot->targetname); self->targetname = spot->targetname; @@ -55,7 +55,7 @@ static void SP_CreateCoopSpots (edict_t *self) { edict_t *spot; - if(stricmp(level.mapname, "security") == 0) + if(Q_stricmp(level.mapname, "security") == 0) { spot = G_Spawn(); spot->classname = "info_player_coop"; @@ -93,7 +93,7 @@ void SP_info_player_start(edict_t *self) { if (!coop->value) return; - if(stricmp(level.mapname, "security") == 0) + if(Q_stricmp(level.mapname, "security") == 0) { // invoke one of our gross, ugly, disgusting hacks self->think = SP_CreateCoopSpots; @@ -126,20 +126,20 @@ void SP_info_player_coop(edict_t *self) return; } - if((stricmp(level.mapname, "jail2") == 0) || - (stricmp(level.mapname, "jail4") == 0) || - (stricmp(level.mapname, "mine1") == 0) || - (stricmp(level.mapname, "mine2") == 0) || - (stricmp(level.mapname, "mine3") == 0) || - (stricmp(level.mapname, "mine4") == 0) || - (stricmp(level.mapname, "lab") == 0) || - (stricmp(level.mapname, "boss1") == 0) || - (stricmp(level.mapname, "fact3") == 0) || - (stricmp(level.mapname, "biggun") == 0) || - (stricmp(level.mapname, "space") == 0) || - (stricmp(level.mapname, "command") == 0) || - (stricmp(level.mapname, "power2") == 0) || - (stricmp(level.mapname, "strike") == 0)) + if((Q_stricmp(level.mapname, "jail2") == 0) || + (Q_stricmp(level.mapname, "jail4") == 0) || + (Q_stricmp(level.mapname, "mine1") == 0) || + (Q_stricmp(level.mapname, "mine2") == 0) || + (Q_stricmp(level.mapname, "mine3") == 0) || + (Q_stricmp(level.mapname, "mine4") == 0) || + (Q_stricmp(level.mapname, "lab") == 0) || + (Q_stricmp(level.mapname, "boss1") == 0) || + (Q_stricmp(level.mapname, "fact3") == 0) || + (Q_stricmp(level.mapname, "biggun") == 0) || + (Q_stricmp(level.mapname, "space") == 0) || + (Q_stricmp(level.mapname, "command") == 0) || + (Q_stricmp(level.mapname, "power2") == 0) || + (Q_stricmp(level.mapname, "strike") == 0)) { // invoke one of our gross, ugly, disgusting hacks self->think = SP_FixCoopSpots; diff --git a/src/p_weapon.c b/src/p_weapon.c index c7321e3..2362173 100644 --- a/src/p_weapon.c +++ b/src/p_weapon.c @@ -705,7 +705,7 @@ void Weapon_Generic (edict_t *ent, int FRAME_ACTIVATE_LAST, int FRAME_FIRE_LAST, fire_frames, fire); // run the weapon frame again if hasted - if (stricmp(ent->client->pers.weapon->pickup_name, "Grapple") == 0 && + if (Q_stricmp(ent->client->pers.weapon->pickup_name, "Grapple") == 0 && ent->client->weaponstate == WEAPON_FIRING) return; @@ -2140,7 +2140,6 @@ void weapon_phalanx_fire (edict_t *ent) vec3_t forward, right, up; vec3_t offset; vec3_t v; - int kick = 12; int damage; float damage_radius; int radius_damage;