Commits

Torr_Samaho  committed a1c926a

[Dusk] Fixed: Picking up a weapon piece caused the local ammo count on the client to go out of sync.

  • Participants
  • Parent commits 1fd8e4d

Comments (0)

Files changed (2)

File docs/Skulltag Version History.txt

 -	- Fixed: Newly connected clients were not informed of other actors' reaction time. [TIHan]
 -	- Fixed: Morphed players turning into spectators leave dummy players behind. [TIHan]
 -	- Fixed: Clients weren't informed of damage caused by initial poisoning or of the accompanying cough sound caused by PoisonCloud. Clients were calling poison-caused Pain states on their own. [Dusk]
+-	- Fixed: Picking up a weapon piece caused the local ammo count on the client to go out of sync. [Dusk]
 !	- 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/g_shared/a_weaponpiece.cpp

 			// [BB] The collection of weapon pieces is handled on the server, so we
 			// need to tell the client that the weapon is completed.
 			if (( NETWORK_GetState( ) == NETSTATE_SERVER ) && ( toucher ) && ( toucher->player ))
-			{
 				SERVERCOMMANDS_GiveInventory( ULONG( toucher->player - players ), FullWeapon );
-				// [BB] The above command gives ammo to the client, but the AttachToOwner command
-				// below fixes the amount.
-			}
+
 			// The weapon itself should not give more ammo to the player!
 			FullWeapon->AmmoGive1=0;
 			FullWeapon->AmmoGive2=0;
 			FullWeapon->AmmoGive2=Defaults->AmmoGive2;
 		}
 	}
+
+	// [Dusk] Update the ammo counts to the client
+	if (( NETWORK_GetState( ) == NETSTATE_SERVER ) && ( toucher ) && ( toucher->player ))
+		SERVERCOMMANDS_SyncPlayerAmmoAmount( ULONG( toucher->player - players ));
+
 	GoAwayAndDie();
 	return true;
 }