Updated TF2 identifiers and condition stocks.
authorNicholas Hastings <skamonkey@gmail.com>
Fri Jun 24 02:01:03 2011 -0400 (2011-06-24)
changeset 3308d76e338633dc
parent 3307 88825dc19d2b
child 3309 ef25ef57a0b0
Updated TF2 identifiers and condition stocks.
plugins/include/tf2.inc
plugins/include/tf2_stocks.inc
     1.1 --- a/plugins/include/tf2.inc	Fri Jun 24 00:53:17 2011 -0400
     1.2 +++ b/plugins/include/tf2.inc	Fri Jun 24 02:01:03 2011 -0400
     1.3 @@ -104,7 +104,9 @@
     1.4  	TFCond_Milked,
     1.5  	TFCond_MegaHeal,
     1.6  	TFCond_RegenBuffed,
     1.7 -	TFCond_MarkedForDeath
     1.8 +	TFCond_MarkedForDeath,
     1.9 +	
    1.10 +	TFCond_SpeedBuffAlly = 32
    1.11  };
    1.12  
    1.13  enum TFHoliday
     2.1 --- a/plugins/include/tf2_stocks.inc	Fri Jun 24 00:53:17 2011 -0400
     2.2 +++ b/plugins/include/tf2_stocks.inc	Fri Jun 24 02:01:03 2011 -0400
     2.3 @@ -122,7 +122,10 @@
     2.4  	TF_CUSTOM_FISH_KILL,
     2.5  	TF_CUSTOM_TRIGGER_HURT,
     2.6  	TF_CUSTOM_DECAPITATION_BOSS,
     2.7 -	TF_CUSTOM_STICKBOMB_EXPLOSION
     2.8 +	TF_CUSTOM_STICKBOMB_EXPLOSION,
     2.9 +	TF_CUSTOM_AEGIS_ROUND,
    2.10 +	TF_CUSTOM_FLARE_EXPLOSION,
    2.11 +	TF_CUSTOM_BOOTS_STOP,
    2.12  };
    2.13  
    2.14  // Weapon codes as used in some events, such as player_death
    2.15 @@ -202,7 +205,10 @@
    2.16  	TF_WEAPON_HANDGUN_SCOUT_PRIMARY,
    2.17  	TF_WEAPON_BAT_FISH,
    2.18  	TF_WEAPON_CROSSBOW,
    2.19 -	TF_WEAPON_STICKBOMB
    2.20 +	TF_WEAPON_STICKBOMB,
    2.21 +	TF_WEAPON_HANDGUN_SCOUT_SEC,
    2.22 +	TF_WEAPON_SODA_POPPER,
    2.23 +	TF_WEAPON_SNIPERRIFLE_DECAP,
    2.24  };
    2.25  
    2.26  // TF2 Weapon Slots for GetPlayerWeaponSlot
    2.27 @@ -412,12 +418,54 @@
    2.28   * @param client		Player's index.
    2.29   * @return				Player's condition bits
    2.30   */
    2.31 +#pragma deprecated Use TF2_IsPlayerInCondition instead.
    2.32  stock TF2_GetPlayerConditionFlags(client)
    2.33  {
    2.34  	return GetEntProp(client, Prop_Send, "m_nPlayerCond")|GetEntProp(client, Prop_Send, "_condition_bits");
    2.35  }
    2.36  
    2.37  /**
    2.38 + * Check whether or not a condition is set on a player
    2.39 + *
    2.40 + * @param client		Player's index.
    2.41 + * @return				True if set, false otherwise
    2.42 + */
    2.43 +stock bool:TF2_IsPlayerInCondition(client, TFCond:cond)
    2.44 +{
    2.45 +	// Conditions are stored in a uint64 now. We need to check each 32-bit segment.
    2.46 +	if (_:cond < 32)
    2.47 +	{
    2.48 +		new bit = (1 << (_:cond - 32));
    2.49 +		if ((GetEntProp(client, Prop_Send, "m_nPlayerCond") & bit) == bit)
    2.50 +		{
    2.51 +			return true;
    2.52 +		}
    2.53 +		
    2.54 +		if ((GetEntProp(client, Prop_Send, "_condition_bits") & bit) == bit)
    2.55 +		{
    2.56 +			return true;
    2.57 +		}
    2.58 +	}
    2.59 +	else
    2.60 +	{
    2.61 +		new bit = 1 << _:cond;		
    2.62 +		new offset = FindSendPropInfo("CTFPlayer", "m_nPlayerCond");
    2.63 +		
    2.64 +		if (offset <= 0)
    2.65 +		{
    2.66 +			ThrowError("Could not find m_nPlayerCond offset from CTFPlayer");
    2.67 +		}
    2.68 +		
    2.69 +		if ((GetEntData(client, (offset+4)) & bit) == bit)
    2.70 +		{
    2.71 +			return true;
    2.72 +		}
    2.73 +	}
    2.74 +	
    2.75 +	return false;
    2.76 +}
    2.77 +
    2.78 +/**
    2.79   * Gets an entity's object type.
    2.80   *
    2.81   * @param entity		Entity index.