From 7143ae49e1f4048f74000bd8390c351cecc1c719 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Thu, 29 Aug 2013 21:45:37 -0500 Subject: [PATCH] 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) --- src/p_acs.cpp | 2 +- src/thingdef/thingdef_codeptr.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index dc696ca45f..b707f4444c 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -8394,7 +8394,7 @@ scriptwait: { 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; } diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index ee3e4ee2f0..f5ef45f45c 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -4935,7 +4935,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetTics) ACTION_PARAM_START(1); 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. for (int i = 0; i < NUMPSPRITES; ++i) {