mirror of
https://github.com/yquake2/rogue.git
synced 2024-11-22 20:31:50 +00:00
Fix Coop Bug in RHANGAR1 when friendly fire was off
In RHANGAR1 the turret didn't blow up the ceiling when friendly fire was off, because in ClientTeam() both entities were set to "" (no team), but OnSameTeam() just did a strcmp() instead of checking this special case (no team). We check this now and thus it works. Hooray. The savegame table entry for this function was invalid, but it doesn't need to be saved anyway, so I just deleted it from the table.
This commit is contained in:
parent
6c854253de
commit
bcbae17d9c
3 changed files with 5 additions and 8 deletions
11
src/g_cmds.c
11
src/g_cmds.c
|
@ -8,11 +8,10 @@
|
||||||
#include "header/local.h"
|
#include "header/local.h"
|
||||||
#include "monster/misc/player.h"
|
#include "monster/misc/player.h"
|
||||||
|
|
||||||
char *
|
static char *
|
||||||
ClientTeam(edict_t *ent)
|
ClientTeam(edict_t *ent, char* value)
|
||||||
{
|
{
|
||||||
char *p;
|
char *p;
|
||||||
static char value[512];
|
|
||||||
|
|
||||||
value[0] = 0;
|
value[0] = 0;
|
||||||
|
|
||||||
|
@ -59,10 +58,10 @@ OnSameTeam(edict_t *ent1, edict_t *ent2)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(ent1Team, ClientTeam(ent1));
|
ClientTeam(ent1, ent1Team);
|
||||||
strcpy(ent2Team, ClientTeam(ent2));
|
ClientTeam(ent2, ent2Team);
|
||||||
|
|
||||||
if (strcmp(ent1Team, ent2Team) == 0)
|
if (ent1Team[0] != '\0' && strcmp(ent1Team, ent2Team) == 0)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1427,7 +1427,6 @@ extern void ValidateSelectedItem ( edict_t * ent ) ;
|
||||||
extern void SelectPrevItem ( edict_t * ent , int itflags ) ;
|
extern void SelectPrevItem ( edict_t * ent , int itflags ) ;
|
||||||
extern void SelectNextItem ( edict_t * ent , int itflags ) ;
|
extern void SelectNextItem ( edict_t * ent , int itflags ) ;
|
||||||
extern qboolean OnSameTeam ( edict_t * ent1 , edict_t * ent2 ) ;
|
extern qboolean OnSameTeam ( edict_t * ent1 , edict_t * ent2 ) ;
|
||||||
extern char * ClientTeam ( edict_t * ent ) ;
|
|
||||||
extern void GetChaseTarget ( edict_t * ent ) ;
|
extern void GetChaseTarget ( edict_t * ent ) ;
|
||||||
extern void ChasePrev ( edict_t * ent ) ;
|
extern void ChasePrev ( edict_t * ent ) ;
|
||||||
extern void ChaseNext ( edict_t * ent ) ;
|
extern void ChaseNext ( edict_t * ent ) ;
|
||||||
|
|
|
@ -1428,7 +1428,6 @@
|
||||||
{"SelectPrevItem", (byte *)SelectPrevItem},
|
{"SelectPrevItem", (byte *)SelectPrevItem},
|
||||||
{"SelectNextItem", (byte *)SelectNextItem},
|
{"SelectNextItem", (byte *)SelectNextItem},
|
||||||
{"OnSameTeam", (byte *)OnSameTeam},
|
{"OnSameTeam", (byte *)OnSameTeam},
|
||||||
{"ClientTeam", (byte *)ClientTeam},
|
|
||||||
{"GetChaseTarget", (byte *)GetChaseTarget},
|
{"GetChaseTarget", (byte *)GetChaseTarget},
|
||||||
{"ChasePrev", (byte *)ChasePrev},
|
{"ChasePrev", (byte *)ChasePrev},
|
||||||
{"ChaseNext", (byte *)ChaseNext},
|
{"ChaseNext", (byte *)ChaseNext},
|
||||||
|
|
Loading…
Reference in a new issue