From 609cf58b4058559025fc5fb09044e11851609182 Mon Sep 17 00:00:00 2001 From: Lyberta Date: Wed, 23 Aug 2017 01:07:50 +0300 Subject: [PATCH] Player templates: Use distinct names for hook handlers. --- qcsrc/server/playertemplates.qc | 15 ++++++++------- qcsrc/server/playertemplates.qh | 15 ++++++++------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/qcsrc/server/playertemplates.qc b/qcsrc/server/playertemplates.qc index 3ee9f11631..ce64c1316f 100644 --- a/qcsrc/server/playertemplates.qc +++ b/qcsrc/server/playertemplates.qc @@ -289,7 +289,7 @@ float PlayerTemplate_GivePlayerItem(entity player, string template, // =========================== Hook handlers ================================= -void PlayerTemplate_PlayerSpawn(entity player, string template) +void PlayerTemplateHook_PlayerSpawn(entity player, string template) { if (template == "default") { @@ -373,12 +373,12 @@ void PlayerTemplate_PlayerSpawn(entity player, string template) } } -bool PlayerTemplate_ForbidThrowCurrentWeapon(string template) +bool PlayerTemplateHook_ForbidThrowCurrentWeapon(string template) { return !PlayerTemplate_GetFloatValue(template, "drop_weapons"); } -float PlayerTemplate_PlayerRegen(entity player, string template) +float PlayerTemplateHook_PlayerRegen(entity player, string template) { if (template == "default") { @@ -399,7 +399,7 @@ float PlayerTemplate_PlayerRegen(entity player, string template) return false; } -float PlayerTemplate_ItemTouch(entity player, entity item, string template) +float PlayerTemplateHook_ItemTouch(entity player, entity item, string template) { if (template == "default") { @@ -1070,8 +1070,9 @@ float PlayerTemplate_ItemTouch(entity player, entity item, string template) return MUT_ITEMTOUCH_CONTINUE; } -float PlayerTemplate_Damage_Calculate(entity attacker, string attackertemplate, - entity victim, string victimtemplate, float deathtype, float damage) +float PlayerTemplateHook_Damage_Calculate(entity attacker, + string attackertemplate, entity victim, string victimtemplate, + float deathtype, float damage) { if (autocvar_g_instagib == 1) { @@ -1088,7 +1089,7 @@ float PlayerTemplate_Damage_Calculate(entity attacker, string attackertemplate, return damage; } -void PlayerTemplate_PlayerDies(entity player, string template) +void PlayerTemplateHook_PlayerDies(entity player, string template) { if (template == "default") { diff --git a/qcsrc/server/playertemplates.qh b/qcsrc/server/playertemplates.qh index 71cc62dab9..985cbcede2 100644 --- a/qcsrc/server/playertemplates.qh +++ b/qcsrc/server/playertemplates.qh @@ -54,25 +54,25 @@ float PlayerTemplate_GivePlayerItem(entity player, string template, /// \param[in,out] player Player to setup. /// \param[in] template Name of the template. /// \return No return. -void PlayerTemplate_PlayerSpawn(entity player, string template); +void PlayerTemplateHook_PlayerSpawn(entity player, string template); /// \brief Forbids weapon dropping according to the given template. /// \param[in] template Name of the template. /// \return Value to pass to mutator hook. -bool PlayerTemplate_ForbidThrowCurrentWeapon(string template); +bool PlayerTemplateHook_ForbidThrowCurrentWeapon(string template); /// \brief Regenerates player health according to the given template. /// \param[in] player Player to regenerate. /// \param[in] template Name of the template. /// \return Value to pass to mutator hook. -float PlayerTemplate_PlayerRegen(entity player, string template); +float PlayerTemplateHook_PlayerRegen(entity player, string template); /// \brief Gives player items according to the given template. /// \param[in,out] player Player to give items to. /// \param[in] item Item which player has picked up. /// \param[in] template Name of the template. /// \return Enum value to pass to mutator hook. -float PlayerTemplate_ItemTouch(entity player, entity item, string template); +float PlayerTemplateHook_ItemTouch(entity player, entity item, string template); /// \brief Changes the damage done using templates' attack and defense scales. /// \param[in] attacke Attacker entity. @@ -82,8 +82,9 @@ float PlayerTemplate_ItemTouch(entity player, entity item, string template); /// \param[in] deathtype Type of the damage. /// \param[in] damage Damage to adjust. /// \return Adjusted damage. -float PlayerTemplate_Damage_Calculate(entity attacker, string attackertemplate, - entity victim, string victimtemplate, float deathtype, float damage); +float PlayerTemplateHook_Damage_Calculate(entity attacker, + string attackertemplate, entity victim, string victimtemplate, + float deathtype, float damage); /// \brief Strips the player of their weapons if the player is not allowed to /// drop them. @@ -91,4 +92,4 @@ float PlayerTemplate_Damage_Calculate(entity attacker, string attackertemplate, /// \param[in] template Name of the template. /// \return No return. /// \note You must hook with CBC_ORDER_FIRST in order for this to be effective. -void PlayerTemplate_PlayerDies(entity player, string template); +void PlayerTemplateHook_PlayerDies(entity player, string template); -- 2.39.5