Fixed: CheckPlayerCamera not sync safe

-  If a player is spying through another player, CheckPlayerCamera will
   return the TID of the player you are "spying", but as coopspy isn't a
   net command, this wont be reflected by all nodes. So to fix this,
   CheckPlayerCamera now returns -1 if a player's camera is that of any
   player at all. (thanks edward850)
This commit is contained in:
Randy Heit 2013-08-29 21:45:37 -05:00
parent aac0de3e48
commit 7143ae49e1
2 changed files with 2 additions and 2 deletions

View File

@ -8394,7 +8394,7 @@ scriptwait:
{ {
int playernum = STACK(1); int playernum = STACK(1);
if (playernum < 0 || playernum >= MAXPLAYERS || !playeringame[playernum] || players[playernum].camera == NULL) if (playernum < 0 || playernum >= MAXPLAYERS || !playeringame[playernum] || players[playernum].camera == NULL || players[playernum].camera->player != NULL)
{ {
STACK(1) = -1; STACK(1) = -1;
} }

View File

@ -4935,7 +4935,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetTics)
ACTION_PARAM_START(1); ACTION_PARAM_START(1);
ACTION_PARAM_INT(tics_to_set, 0); ACTION_PARAM_INT(tics_to_set, 0);
if (stateowner != self && self->player != NULL) if (stateowner != self && self->player != NULL && stateowner->IsKindOf(RUNTIME_CLASS(AWeapon)))
{ // Is this a weapon? Need to check psp states for a match, then. Blah. { // Is this a weapon? Need to check psp states for a match, then. Blah.
for (int i = 0; i < NUMPSPRITES; ++i) for (int i = 0; i < NUMPSPRITES; ++i)
{ {