From dcb9efa131dde498c5f39feed1c44bd6f5db30ea Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Fri, 11 Apr 2008 07:58:06 +0000 Subject: [PATCH] Fixed amb1594 - SetPlayerClass issues with spawning --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402034 --- plugins/include/tf2_stocks.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/include/tf2_stocks.inc b/plugins/include/tf2_stocks.inc index c9f754c6..a4998049 100644 --- a/plugins/include/tf2_stocks.inc +++ b/plugins/include/tf2_stocks.inc @@ -98,6 +98,8 @@ stock TFClassType:TF2_GetPlayerClass(client) /** * Set's a Clients class. * + * Note: If setting player class in a player spawn hook weapons should be set to false. + * * @param client Player's index. * @param class TFClassType class symbol. * @param weapons If true, changes the players weapon set to that of the new class. @@ -110,7 +112,7 @@ stock TF2_SetPlayerClass(client, TFClassType:class, bool:weapons=true) SetEntProp(client, Prop_Send, "m_iDesiredPlayerClass", _:class); TF2_SetPlayerResourceData(client, TFResource_PlayerClass, class); - if (weapons) + if (weapons && IsPlayerAlive(client)) { TF2_RemoveAllWeapons(client); TF2_EquipPlayerClassWeapons(client, class);