]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into terencehill/replicatevars_enhancements 964/head
authorterencehill <piuntn@gmail.com>
Thu, 10 Feb 2022 01:21:11 +0000 (02:21 +0100)
committerterencehill <piuntn@gmail.com>
Thu, 10 Feb 2022 01:21:11 +0000 (02:21 +0100)
1  2 
qcsrc/client/main.qc
qcsrc/client/view.qc
qcsrc/common/mutators/mutator/nades/nades.qc
qcsrc/common/playerstats.qc
qcsrc/common/weapons/all.qc
qcsrc/server/client.qc
qcsrc/server/client.qh
qcsrc/server/items/items.qc
qcsrc/server/mutators/events.qh

diff --combined qcsrc/client/main.qc
index d817b6be6c33cd6d11e6d84f5e1613eba77d73a5,649def85c615fc859904c25f129d12c2e84ec1cd..7acbfe6cbafb20b4b0ee7ec41441e79828153dc7
@@@ -4,6 -4,7 +4,7 @@@
  #include <client/draw.qh>
  #include <client/hud/_mod.qh>
  #include <client/hud/panel/centerprint.qh>
+ #include <client/hud/panel/chat.qh>
  #include <client/hud/panel/quickmenu.qh>
  #include <client/hud/panel/scoreboard.qh>
  #include <client/items/items.qh>
@@@ -57,7 -58,7 +58,7 @@@ void CSQC_Init(
                maxclients = i;
        }
  
 -      ReplicateVars_Send_All();
 +      ReplicateVars(REPLICATEVARS_SEND_ALL);
  
        // needs to be done so early because of the constants they create
        static_init();
@@@ -189,7 -190,7 +190,7 @@@ void Shutdown(
        deactivate_minigame();
        HUD_MinigameMenu_Close(NULL, NULL, NULL);
  
 -      ReplicateVars_Destroy();
 +      ReplicateVars(REPLICATEVARS_DESTROY);
  }
  
  void AuditLists()
@@@ -452,10 -453,13 +453,13 @@@ float CSQC_InputEvent(int bInputType, f
  {
        TC(int, bInputType);
        bool override = false;
        override |= HUD_Panel_InputEvent(bInputType, nPrimary, nSecondary);
        if (override)
                return true;
  
+       override |= HUD_Panel_Chat_InputEvent(bInputType, nPrimary, nSecondary);
        override |= QuickMenu_InputEvent(bInputType, nPrimary, nSecondary);
  
        override |= HUD_Radar_InputEvent(bInputType, nPrimary, nSecondary);
diff --combined qcsrc/client/view.qc
index b25dc11d7d02b347e359307de33506de36d350db,34ba8595f050e97c8cbc75e911ed3d25b55fb4ee..0d2d6e1227aade3dddc156b94719f546f58f77b5
@@@ -770,7 -770,7 +770,7 @@@ void UpdateDamage(
  {
        // accumulate damage with each stat update
        static float damage_total_prev = 0;
-       float damage_total = STAT(DAMAGE_DEALT_TOTAL);
+       float damage_total = STAT(HITSOUND_DAMAGE_DEALT_TOTAL);
        float unaccounted_damage_new = COMPARE_INCREASING(damage_total, damage_total_prev);
        damage_total_prev = damage_total;
  
@@@ -1540,7 -1540,7 +1540,7 @@@ void CSQC_UpdateView(entity this, floa
        stats_get();
        hud = STAT(HUD);
  
 -      ReplicateVars_Check();
 +      ReplicateVars(REPLICATEVARS_CHECK);
  
        HUD_Scale_Disable();
  
index 2869d4f220def17140853c61e13c6a5b368513a3,f4eb49b614c9a1c0b63d3f89f25d2b4c2b3010bf..7a00bd686b5b122b4b481e42fced7119becc67ce
@@@ -11,7 -11,6 +11,7 @@@ float autocvar_g_nades_spread = 0.04
  REGISTER_STAT(NADES_SMALL, int, autocvar_g_nades_nade_small)
  
  #ifdef GAMEQC
 +
  REPLICATE(cvar_cl_nade_type, int, "cl_nade_type");
  REPLICATE(cvar_cl_pokenade_type, string, "cl_pokenade_type");
  
@@@ -590,9 -589,9 +590,9 @@@ void nade_entrap_touch(entity this, ent
        #endif
        }
  
-       if ( IS_REAL_CLIENT(toucher) || IS_VEHICLE(toucher) || IS_MONSTER(toucher) )
+       if ( IS_REAL_CLIENT(toucher) || (IS_VEHICLE(toucher) && toucher.owner) )
        {
-               entity show_tint = (IS_VEHICLE(toucher)) ? toucher.owner : toucher;
+               entity show_tint = (IS_VEHICLE(toucher) && toucher.owner) ? toucher.owner : toucher;
                STAT(ENTRAP_ORB, show_tint) = time + 0.1;
  
                float tint_alpha = 0.75;
@@@ -646,9 -645,9 +646,9 @@@ void nade_heal_touch(entity this, entit
  
        }
  
-       if ( IS_REAL_CLIENT(toucher) || IS_VEHICLE(toucher) )
+       if ( IS_REAL_CLIENT(toucher) || (IS_VEHICLE(toucher) && toucher.owner) )
        {
-               entity show_red = (IS_VEHICLE(toucher)) ? toucher.owner : toucher;
+               entity show_red = (IS_VEHICLE(toucher) && toucher.owner) ? toucher.owner : toucher;
                STAT(HEALING_ORB, show_red) = time+0.1;
                STAT(HEALING_ORB_ALPHA, show_red) = 0.75 * (this.ltime - time) / this.orb_lifetime;
        }
@@@ -675,9 -674,9 +675,9 @@@ void nade_monster_boom(entity this
  
  void nade_veil_touch(entity this, entity toucher)
  {
-       if ( IS_REAL_CLIENT(toucher) || IS_VEHICLE(toucher) || IS_MONSTER(toucher) )
+       if ( IS_REAL_CLIENT(toucher) || (IS_VEHICLE(toucher) && toucher.owner) )
        {
-               entity show_tint = (IS_VEHICLE(toucher)) ? toucher.owner : toucher;
+               entity show_tint = (IS_VEHICLE(toucher) && toucher.owner) ? toucher.owner : toucher;
  
                float tint_alpha = 0.75;
                if(SAME_TEAM(toucher, this.realowner))
index ac3c46822ef472574a08809e41f90ca6058c3640,e3b1e8461c77e796ff70ddf98f5f8903ea3406cb..2ac431b75ae4610599a7181880aeb1431789f040
        #include <server/world.qh>
  #endif
  
 +
 +#ifdef GAMEQC
 +REPLICATE(cvar_cl_allow_uid2name, int, "cl_allow_uid2name");
 +REPLICATE(cvar_cl_allow_uidranking, bool, "cl_allow_uidranking");
 +REPLICATE(cvar_cl_allow_uidtracking, int, "cl_allow_uidtracking");
 +#endif
 +
 +#ifdef SVQC
 +REPLICATE_APPLYCHANGE("cl_allow_uidtracking", { PlayerStats_GameReport_AddPlayer(this); });
 +#endif
 +
  #ifdef SVQC
  void PlayerStats_Prematch()
  {
@@@ -279,6 -268,10 +279,10 @@@ void PlayerStats_GameReport_Init() // i
                PlayerStats_GameReport_DelayMapVote = true;
  
                serverflags |= SERVERFLAG_PLAYERSTATS;
+               if(autocvar_g_playerstats_gamereport_uri != cvar_defstring("g_playerstats_gamereport_uri"))
+               {
+                       serverflags |= SERVERFLAG_PLAYERSTATS_CUSTOM;
+               }
  
                PlayerStats_GameReport_AddEvent(PLAYERSTATS_ALIVETIME);
                PlayerStats_GameReport_AddEvent(PLAYERSTATS_AVGLATENCY);
index 00e71e0debe942fe1a0ef0c9bd8933ca4a634da7,e1efeb02e933c4559f5455d8e1691fd1a42f7ecc..6bf2d105f8d85c4c82299c9a216f3e20cd818062
@@@ -202,7 -202,8 +202,8 @@@ WepSet W_RandomWeapons(entity e, WepSe
        return result;
  }
  
- string GetAmmoPicture(int ammotype)
+ // TODO: registry handles for below functions
+ string GetAmmoPicture(Resource ammotype)
  {
        switch (ammotype)
        {
        }
  }
  
- string GetAmmoName(int ammotype)
+ string GetAmmoName(Resource ammotype)
  {
        switch (ammotype)
        {
        }
  }
  
- entity GetAmmoItem(int ammotype)
+ entity GetAmmoItem(Resource ammotype)
  {
        switch (ammotype)
        {
                case RES_PLASMA:  return ITEM_Plasma;
                case RES_FUEL:    return ITEM_JetpackFuel;
        }
-       LOG_WARNF("Invalid ammo type %d ", ammotype);
+       LOG_WARNF("Invalid ammo type %d ", ammotype.m_id);
        return NULL;
        // WEAPONTODO: use this generic func to reduce duplication ?
        // GetAmmoPicture  GetAmmoName  notif_arg_item_wepammo  ammo_pickupevalfunc ?
  }
  
  #ifdef CSQC
int GetAmmoTypeFromNum(int i)
Resource GetAmmoTypeFromNum(int i)
  {
        switch (i)
        {
        }
  }
  
- int GetAmmoStat(int ammotype)
+ int GetAmmoStat(Resource ammotype)
  {
        switch (ammotype)
        {
@@@ -826,35 -827,3 +827,35 @@@ NET_HANDLE(w_muzzleflash, bool isNew
  #endif
  
  #endif
 +
 +#ifdef SVQC
 +string W_FixWeaponOrder_ForceComplete_AndBuildImpulseList(entity this, string wo)
 +{
 +      string o = W_FixWeaponOrder_ForceComplete(wo);
 +      strcpy(CS_CVAR(this).weaponorder_byimpulse, W_FixWeaponOrder_BuildImpulseList(o));
 +      return o;
 +}
 +#endif
 +
 +#ifdef CSQC
 +REPLICATE(cvar_cl_accuracy_data_share, bool, "cl_accuracy_data_share");
 +REPLICATE(cvar_cl_accuracy_data_receive, bool, "cl_accuracy_data_receive");
 +#endif
 +
 +#ifdef GAMEQC
 +REPLICATE(cvar_cl_gunalign, int, "cl_gunalign");
 +REPLICATE(cvar_cl_weapon_switch_reload, bool, "cl_weapon_switch_reload");
 +REPLICATE(cvar_cl_weapon_switch_fallback_to_impulse, bool, "cl_weapon_switch_fallback_to_impulse");
 +REPLICATE(cvar_cl_weaponimpulsemode, int, "cl_weaponimpulsemode");
 +REPLICATE(cvar_cl_weaponpriority, string, "cl_weaponpriority", W_FixWeaponOrder_ForceComplete_AndBuildImpulseList);
 +REPLICATE(cvar_cl_weaponpriorities[0], string, "cl_weaponpriority0", W_FixWeaponOrder_AllowIncomplete);
 +REPLICATE(cvar_cl_weaponpriorities[1], string, "cl_weaponpriority1", W_FixWeaponOrder_AllowIncomplete);
 +REPLICATE(cvar_cl_weaponpriorities[2], string, "cl_weaponpriority2", W_FixWeaponOrder_AllowIncomplete);
 +REPLICATE(cvar_cl_weaponpriorities[3], string, "cl_weaponpriority3", W_FixWeaponOrder_AllowIncomplete);
 +REPLICATE(cvar_cl_weaponpriorities[4], string, "cl_weaponpriority4", W_FixWeaponOrder_AllowIncomplete);
 +REPLICATE(cvar_cl_weaponpriorities[5], string, "cl_weaponpriority5", W_FixWeaponOrder_AllowIncomplete);
 +REPLICATE(cvar_cl_weaponpriorities[6], string, "cl_weaponpriority6", W_FixWeaponOrder_AllowIncomplete);
 +REPLICATE(cvar_cl_weaponpriorities[7], string, "cl_weaponpriority7", W_FixWeaponOrder_AllowIncomplete);
 +REPLICATE(cvar_cl_weaponpriorities[8], string, "cl_weaponpriority8", W_FixWeaponOrder_AllowIncomplete);
 +REPLICATE(cvar_cl_weaponpriorities[9], string, "cl_weaponpriority9", W_FixWeaponOrder_AllowIncomplete);
 +#endif
diff --combined qcsrc/server/client.qc
index 376182266269f0e32142c99707fe96732ac30155,e35f1a8652dbfc61bfdbe598dcd7d494e8a75f23..7592d11609e4c89e6115e05c1bfdce54ddc684bb
@@@ -30,6 -30,7 +30,7 @@@
  #include <common/notifications/all.qh>
  #include <common/physics/player.qh>
  #include <common/playerstats.qh>
+ #include <common/resources/sv_resources.qh>
  #include <common/state.qh>
  #include <common/stats.qh>
  #include <common/vehicles/all.qh>
@@@ -65,7 -66,6 +66,6 @@@
  #include <server/player.qh>
  #include <server/portals.qh>
  #include <server/race.qh>
- #include <server/resources.qh>
  #include <server/scores.qh>
  #include <server/scores_rules.qh>
  #include <server/spawnpoints.qh>
@@@ -935,7 -935,6 +935,6 @@@ void DecodeLevelParms(entity this
  void FixClientCvars(entity e)
  {
        // send prediction settings to the client
-       stuffcmd(e, "\nin_bindmap 0 0\n");
        if(autocvar_g_antilag == 3) // client side hitscan
                stuffcmd(e, "cl_cmd settemp cl_prydoncursor_notrace 0\n");
        if(autocvar_sv_gentle)
@@@ -1554,7 -1553,7 +1553,7 @@@ float CalcRot(float current, float stab
                return max(stable, current + (stable - current) * rotfactor * rotframetime);
  }
  
- void RotRegen(entity this, int res, float limit_mod,
+ void RotRegen(entity this, Resource res, float limit_mod,
        float regenstable, float regenfactor, float regenlinear, float regenframetime,
        float rotstable, float rotfactor, float rotlinear, float rotframetime)
  {
@@@ -2511,9 -2510,12 +2510,9 @@@ void PlayerPreThink (entity this
                this.last_vehiclecheck = time + 1;
        }
  
 -      if(!CS_CVAR(this).cvar_cl_newusekeysupported) // FIXME remove this - it was a stupid idea to begin with, we can JUST use the button
 -      {
 -              if(PHYS_INPUT_BUTTON_USE(this) && !CS(this).usekeypressed)
 -                      PlayerUseKey(this);
 -              CS(this).usekeypressed = PHYS_INPUT_BUTTON_USE(this);
 -      }
 +      if(PHYS_INPUT_BUTTON_USE(this) && !CS(this).usekeypressed)
 +              PlayerUseKey(this);
 +      CS(this).usekeypressed = PHYS_INPUT_BUTTON_USE(this);
  
        if (IS_REAL_CLIENT(this))
                PrintWelcomeMessage(this);
diff --combined qcsrc/server/client.qh
index 862bfffbef7a0705f3f342589c25e1317353261a,b2cf8edb743d342f0c3037d7eab89a2a7fc6043f..8f7b9c4f3224be1655e2b73cdaa5553e62f7957f
@@@ -2,6 -2,7 +2,7 @@@
  
  #include "utils.qh"
  #include <server/intermission.qh>
+ //#include <common/resources/resources.qh>
  #include <common/replicate.qh>
  #include <common/sounds/all.qh>
  
@@@ -211,11 -212,12 +212,11 @@@ CLASS(Client, Object
      ATTRIB(Client, cvar_cl_clippedspectating, bool, this.cvar_cl_clippedspectating);
      ATTRIB(Client, cvar_cl_autoscreenshot, int, this.cvar_cl_autoscreenshot);
      ATTRIB(Client, cvar_cl_jetpack_jump, bool, this.cvar_cl_jetpack_jump);
 -    ATTRIB(Client, cvar_cl_newusekeysupported, bool, this.cvar_cl_newusekeysupported);
      ATTRIB(Client, cvar_cl_noantilag, bool, this.cvar_cl_noantilag);
      ATTRIB(Client, cvar_cl_movement_track_canjump, bool, this.cvar_cl_movement_track_canjump);
      ATTRIB(Client, cvar_cl_weaponimpulsemode, int, this.cvar_cl_weaponimpulsemode);
      ATTRIB(Client, cvar_g_xonoticversion, string, this.cvar_g_xonoticversion);
 -    ATTRIB(Client, autoswitch, bool, this.autoswitch);
 +    ATTRIB(Client, cvar_cl_autoswitch, bool, this.cvar_cl_autoswitch);
      ATTRIB(Client, cvar_cl_casings, bool, this.cvar_cl_casings);
      ATTRIB(Client, cvar_r_drawviewmodel, bool, this.cvar_r_drawviewmodel);
      ATTRIB(Client, cvar_cl_dodging_timeout, float, this.cvar_cl_dodging_timeout);
@@@ -375,7 -377,8 +376,8 @@@ STATIC_INIT(g_initforplayer) { g_initfo
  void play_countdown(entity this, float finished, Sound samp);
  void player_powerups_remove_all(entity this);
  
- void RotRegen(entity this, float current, float limit_mod,
+ // NOTE: current type is Resource (avoiding circular includes!)
+ void RotRegen(entity this, entity current, float limit_mod,
        float regenstable, float regenfactor, float regenlinear, float regenframetime,
        float rotstable, float rotfactor, float rotlinear, float rotframetime);
  
index 8c1281307b20ef15ce32d342bb0eea2d592b483e,0ea10da5e389ef37a23402584390aa671470fa16..57b245a252a167b2beb7b069f1b2f12bac1ccbfd
@@@ -12,6 -12,7 +12,7 @@@
  #include <common/mutators/mutator/powerups/_mod.qh>
  #include <common/mutators/mutator/status_effects/_mod.qh>
  #include <common/notifications/all.qh>
+ #include <common/resources/resources.qh>
  #include <common/util.qh>
  #include <common/weapons/_all.qh>
  #include <common/wepent.qh>
@@@ -447,7 -448,7 +448,7 @@@ void GiveRandomWeapons(entity receiver
        }
  }
  
- bool Item_GiveAmmoTo(entity item, entity player, int res_type, float ammomax)
+ bool Item_GiveAmmoTo(entity item, entity player, Resource res_type, float ammomax)
  {
        float amount = GetResource(item, res_type);
        if (amount == 0)
@@@ -483,7 -484,7 +484,7 @@@ bool Item_GiveTo(entity item, entity pl
        // if the player is using their best weapon before items are given, they
        // probably want to switch to an even better weapon after items are given
  
 -      if(CS_CVAR(player).autoswitch)
 +      if(CS_CVAR(player).cvar_cl_autoswitch)
        {
                for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
                {
@@@ -1450,7 -1451,7 +1451,7 @@@ void GiveRot(entity e, float v0, float 
        else if(v0 > v1)
                e.(regenfield) = max(e.(regenfield), time + regentime);
  }
- bool GiveResourceValue(entity e, int res_type, int op, int val)
+ bool GiveResourceValue(entity e, Resource res_type, int op, int val)
  {
        int v0 = GetResource(e, res_type);
        float new_val = 0;
@@@ -1512,7 -1513,7 +1513,7 @@@ float GiveItems(entity e, float beginar
  
        int _switchweapon = 0;
  
 -      if(CS_CVAR(e).autoswitch)
 +      if(CS_CVAR(e).cvar_cl_autoswitch)
        {
                for(int slot = 0; slot < MAX_WEAPONSLOTS; ++slot)
                {
index c9c8ab8517be036b29d6c1ec9d5798aee2eb41f1,abda2bda31545d8238601007c15547a0026a7ee0..e7ca8583fd17062d13dc682808a2cc9469803c61
@@@ -317,17 -317,8 +317,17 @@@ MUTATOR_HOOKABLE(PlayerPreThink, EV_Pla
      /**/
  MUTATOR_HOOKABLE(GetPressedKeys, EV_GetPressedKeys);
  
 -/** is meant to call GetCvars_handle*(get_cvars_s, get_cvars_f, cvarfield, "cvarname") for cvars this mutator needs from the client */
 -// NOTE: requesting cvar values (get_cvars_f 0) is deprecated
 +/**
 + * is meant to call GetCvars_handle* for cvars this mutator needs from the client, e.g.:
 +      MUTATOR_HOOKFUNCTION(mymutator, GetCvars)
 +      {
 +              GetCvars_handleFloat(this, store, s, f, cvar_mycvar, "mycvar");
 +              return false;
 +      }
 + * Usually you can just use REPLICATE instead of this hook, e.g.:
 +      REPLICATE(cvar_mycvar, int, "mycvar");
 + * NOTE: requesting cvar values (get_cvars_f 0) is deprecated
 + */
  #define EV_GetCvars(i, o) \
      /**/ i(float, get_cvars_f) \
      /**/ i(string, get_cvars_s) \
@@@ -718,7 -709,7 +718,7 @@@ MUTATOR_HOOKABLE(ItemTouched, EV_ItemTo
  resource limit. */
  #define EV_GetResourceLimit(i, o) \
        /** checked entity */ i(entity, MUTATOR_ARGV_0_entity) \
-       /** resource type */  i(int, MUTATOR_ARGV_1_int) \
+       /** resource type */  i(entity, MUTATOR_ARGV_1_entity) \
        /** limit */          i(float, MUTATOR_ARGV_2_float) \
        /**/                  o(float, MUTATOR_ARGV_2_float) \
        /**/
@@@ -728,8 -719,8 +728,8 @@@ MUTATOR_HOOKABLE(GetResourceLimit, EV_G
  constants for resource types. Return true to forbid the change. */
  #define EV_SetResource(i, o) \
        /** checked entity */ i(entity, MUTATOR_ARGV_0_entity) \
-       /** resource type */  i(int, MUTATOR_ARGV_1_int) \
-       /**/                  o(int, MUTATOR_ARGV_1_int) \
+       /** resource type */  i(entity, MUTATOR_ARGV_1_entity) \
+       /**/                  o(entity, MUTATOR_ARGV_1_entity) \
        /** amount */         i(float, MUTATOR_ARGV_2_float) \
        /**/                  o(float, MUTATOR_ARGV_2_float) \
        /**/
@@@ -740,7 -731,7 +740,7 @@@ constants for resource types. Amount wa
  above resource limit so it was not given. */
  #define EV_ResourceAmountChanged(i, o) \
        /** checked entity */ i(entity, MUTATOR_ARGV_0_entity) \
-       /** resource type */  i(int, MUTATOR_ARGV_1_int) \
+       /** resource type */  i(entity, MUTATOR_ARGV_1_entity) \
        /** amount */         i(float, MUTATOR_ARGV_2_float) \
        /**/
  MUTATOR_HOOKABLE(ResourceAmountChanged, EV_ResourceAmountChanged);
@@@ -750,7 -741,7 +750,7 @@@ limit. See RES_* constants for resourc
  of resource that is above resource limit so it was not given. */
  #define EV_ResourceWasted(i, o) \
        /** checked entity */ i(entity, MUTATOR_ARGV_0_entity) \
-       /** resource type */  i(int, MUTATOR_ARGV_1_int) \
+       /** resource type */  i(entity, MUTATOR_ARGV_1_entity) \
        /** amount wasted */  i(float, MUTATOR_ARGV_2_float) \
        /**/
  MUTATOR_HOOKABLE(ResourceWasted, EV_ResourceWasted);
@@@ -760,8 -751,8 +760,8 @@@ for resource types. Return true to forb
  NOTE: This hook is also called by GiveResourceWithLimit */
  #define EV_GiveResource(i, o) \
        /** receiver */      i(entity, MUTATOR_ARGV_0_entity) \
-       /** resource type */ i(int, MUTATOR_ARGV_1_int) \
-       /**/                 o(int, MUTATOR_ARGV_1_int) \
+       /** resource type */ i(entity, MUTATOR_ARGV_1_entity) \
+       /**/                 o(entity, MUTATOR_ARGV_1_entity) \
        /** amount */        i(float, MUTATOR_ARGV_2_float) \
        /**/                 o(float, MUTATOR_ARGV_2_float) \
        /**/
@@@ -771,8 -762,8 +771,8 @@@ MUTATOR_HOOKABLE(GiveResource, EV_GiveR
  RES_* constants for resource types. Return true to forbid giving. */
  #define EV_GiveResourceWithLimit(i, o) \
        /** receiver */      i(entity, MUTATOR_ARGV_0_entity) \
-       /** resource type */ i(int, MUTATOR_ARGV_1_int) \
-       /**/                 o(int, MUTATOR_ARGV_1_int) \
+       /** resource type */ i(entity, MUTATOR_ARGV_1_entity) \
+       /**/                 o(entity, MUTATOR_ARGV_1_entity) \
        /** amount */        i(float, MUTATOR_ARGV_2_float) \
        /**/                 o(float, MUTATOR_ARGV_2_float) \
        /** limit */         i(float, MUTATOR_ARGV_3_float) \
@@@ -785,8 -776,8 +785,8 @@@ for resource types. Return true to forb
  NOTE: This hook is also called by TakeResourceWithLimit */
  #define EV_TakeResource(i, o) \
      /** receiver */      i(entity, MUTATOR_ARGV_0_entity) \
-     /** resource type */ i(int, MUTATOR_ARGV_1_int) \
-     /**/                 o(int, MUTATOR_ARGV_1_int) \
+     /** resource type */ i(entity, MUTATOR_ARGV_1_entity) \
+     /**/                 o(entity, MUTATOR_ARGV_1_entity) \
      /** amount */        i(float, MUTATOR_ARGV_2_float) \
      /**/                 o(float, MUTATOR_ARGV_2_float) \
      /**/
@@@ -796,8 -787,8 +796,8 @@@ MUTATOR_HOOKABLE(TakeResource, EV_TakeR
  RES_* constants for resource types. Return true to forbid giving. */
  #define EV_TakeResourceWithLimit(i, o) \
      /** receiver */      i(entity, MUTATOR_ARGV_0_entity) \
-     /** resource type */ i(int, MUTATOR_ARGV_1_int) \
-     /**/                 o(int, MUTATOR_ARGV_1_int) \
+     /** resource type */ i(entity, MUTATOR_ARGV_1_entity) \
+     /**/                 o(entity, MUTATOR_ARGV_1_entity) \
      /** amount */        i(float, MUTATOR_ARGV_2_float) \
      /**/                 o(float, MUTATOR_ARGV_2_float) \
      /** limit */         i(float, MUTATOR_ARGV_3_float) \