Commits

Torr_Samaho  committed 500db4a

[TIHan, Torr Samaho] Fixed: Spectators were affected by SetPlayerProperty and SetActorProperty.

  • Participants
  • Parent commits 849d5e8

Comments (0)

Files changed (3)

File docs/Skulltag Version History.txt

 -	- Fixed: Wound state changes weren't sent to clients. [Dusk, Torr Samaho]
 -	- Fixed: The server always instructed clients to use the standard pain state of an actor, not any custom one. [Dusk, Torr Samaho]
 -	- Fixed: Newly connecting clients were not informed about non-standard death states of corpses already on the map. [Dusk, Torr Samaho]
+-	- Fixed: Spectators were affected by SetPlayerProperty and SetActorProperty. [TIHan, Torr Samaho]
 !	- Changed F12 to allow spectators full spying, with the exception of during LMS if it's disabled. [Eruanna]
 !	- Changed F12 to allow full demo spying. [Eruanna]
 !	- Players aren't forced to spectate after a "changemap" map change on a server with a join password anymore. [Torr Samaho]

File src/p_acs.cpp

 	{
 		return;
 	}
+
+	// [WS/BB] Do not do this for spectators.
+	if ( actor->player && actor->player->bSpectating )
+		return;
+
 	switch (property)
 	{
 	case APROP_Health:

File src/p_lnspec.cpp

 
 		if (arg0 == 0)
 		{
+			// [WS] If the player is spectating, do nothing. The reason this check is put here and
+			// not at the beginning is because we may want the spectator to be able to puke a command
+			// that gets activated on all players that are currently spawned/(not spectating).
+			if ( it->player && it->player->bSpectating )
+				return false;
+
 			if (arg1)
 			{ // Give power to activator
 				if (power != 4)
 
 			for (i = 0; i < MAXPLAYERS; i++)
 			{
-				if (!playeringame[i] || players[i].mo == NULL)
+				// [WS] Do not do this for spectators.
+				if (!playeringame[i] || players[i].mo == NULL || players[i].bSpectating)
 					continue;
 
 				if (arg1)