]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Type check class methods
authorTimePath <andrew.hardaker1995@gmail.com>
Tue, 22 Mar 2016 05:23:01 +0000 (16:23 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Tue, 22 Mar 2016 05:23:01 +0000 (16:23 +1100)
23 files changed:
qcsrc/client/commands/cl_cmd.qc
qcsrc/client/commands/cl_cmd.qh
qcsrc/common/command/all.qh
qcsrc/common/command/command.qh
qcsrc/common/command/generic.qc
qcsrc/common/effects/effectinfo.qc
qcsrc/common/gamemodes/gamemode/nexball/nexball.qc
qcsrc/common/items/item.qh
qcsrc/common/items/item/pickup.qh
qcsrc/common/mapinfo.qh
qcsrc/common/models/model.qh
qcsrc/common/monsters/monster.qh
qcsrc/common/monsters/monster/mage.qc
qcsrc/common/monsters/monster/shambler.qc
qcsrc/common/monsters/monster/spider.qc
qcsrc/common/monsters/monster/wyvern.qc
qcsrc/common/monsters/monster/zombie.qc
qcsrc/common/sounds/sound.qh
qcsrc/common/state.qh
qcsrc/lib/oo.qh
qcsrc/server/command/all.qh
qcsrc/server/command/common.qh
qcsrc/server/command/sv_cmd.qc

index fdc7dae708d2a403dfc867c4f907850d3ee1c740..6dadff2f3cb8e610b2fd81bfbd78f77807557614 100644 (file)
@@ -489,7 +489,7 @@ bool LocalCommand_macro_command(int argc, string command)
 {
        string c = strtolower(argv(0));
        FOREACH(CLIENT_COMMANDS, it.m_name == c, {
-               it.m_invokecmd(CMD_REQUEST_COMMAND, NULL, argc, command);
+               it.m_invokecmd(it, CMD_REQUEST_COMMAND, NULL, argc, command);
                return true;
        });
        return false;
@@ -499,7 +499,7 @@ bool LocalCommand_macro_usage(int argc)
 {
        string c = strtolower(argv(1));
        FOREACH(CLIENT_COMMANDS, it.m_name == c, {
-               it.m_invokecmd(CMD_REQUEST_USAGE, NULL, argc, "");
+               it.m_invokecmd(it, CMD_REQUEST_USAGE, NULL, argc, "");
                return true;
        });
        return false;
index 857adeaac450ddbff73ca9e67a103563c0f66af9..65a723389e793645f7f2a674a8277ad85d61f0a8 100644 (file)
@@ -17,7 +17,7 @@ REGISTRY_SORT(CLIENT_COMMANDS)
        ATTRIB(clientcommand_##id, m_description, string, description); \
        ENDCLASS(clientcommand_##id) \
     REGISTER(CLIENT_COMMANDS, CMD_CL, id, m_id, NEW(clientcommand_##id)); \
-       METHOD(clientcommand_##id, m_invokecmd, void(int request, entity caller, int arguments, string command))
+       METHOD(clientcommand_##id, m_invokecmd, void(clientcommand_##id this, int request, entity caller, int arguments, string command))
 
 STATIC_INIT(CLIENT_COMMANDS_aliases) {
        FOREACH(CLIENT_COMMANDS, true, localcmd(sprintf("alias %1$s \"%2$s %1$s ${* ?}\"\n", it.m_name, "qc_cmd_cl")));
index 9bbce5e14a67d6d57474de504b1b696d1c9281f5..129090d3ab442b0bfeaf468434a778fbe4f7147a 100644 (file)
@@ -13,7 +13,7 @@ REGISTRY_SORT(GENERIC_COMMANDS)
        ATTRIB(genericcommand_##id, m_description, string, description); \
        ENDCLASS(genericcommand_##id) \
     REGISTER(GENERIC_COMMANDS, CMD_G, id, m_id, NEW(genericcommand_##id)); \
-       METHOD(genericcommand_##id, m_invokecmd, void(int request, entity caller, int arguments, string command))
+       METHOD(genericcommand_##id, m_invokecmd, void(genericcommand_##id this, int request, entity caller, int arguments, string command))
 
 STATIC_INIT(GENERIC_COMMANDS_aliases) {
        FOREACH(GENERIC_COMMANDS, true, localcmd(sprintf("alias %1$s \"%2$s %1$s ${* ?}\"\n", it.m_name, "qc_cmd_svmenu")));
index beda2288c9ff97e9bc7ee2ad4fcdb2426b263b62..72eaa18dabb3189c7185ced9e66eeb686ddab832 100644 (file)
@@ -7,7 +7,10 @@ const int CMD_REQUEST_USAGE = 2;
 CLASS(Command, Object)
        ATTRIB(Command, m_name, string, string_null);
        ATTRIB(Command, m_description, string, string_null);
-       METHOD(Command, m_invokecmd, void(int request, entity caller, int arguments, string command)) { }
+       METHOD(Command, m_invokecmd, void(Command this, int request, entity caller, int arguments, string command))
+       {
+        TC(Command, this);
+       }
 ENDCLASS(Command)
 
 #endif
index 50cc49076d56b438c5d0d0e5f5df2eda6dd550a1..90d6cefe7bb4d0ac7819f9eecdb5edd859ab966b 100644 (file)
@@ -544,7 +544,7 @@ float GenericCommand_macro_command(float argc, string command)
 {
        string c = strtolower(argv(0));
        FOREACH(GENERIC_COMMANDS, it.m_name == c, {
-               it.m_invokecmd(CMD_REQUEST_COMMAND, NULL, argc, command);
+               it.m_invokecmd(it, CMD_REQUEST_COMMAND, NULL, argc, command);
                return true;
        });
        return false;
@@ -554,7 +554,7 @@ float GenericCommand_macro_usage(float argc)
 {
        string c = strtolower(argv(1));
        FOREACH(GENERIC_COMMANDS, it.m_name == c, {
-               it.m_invokecmd(CMD_REQUEST_USAGE, NULL, argc, "");
+               it.m_invokecmd(it, CMD_REQUEST_USAGE, NULL, argc, "");
                return true;
        });
        return false;
index da98946021b611dfc731f597b57ab60832c70249..07d76c480a07627cddc8b284c1e614c89e804e16 100644 (file)
@@ -197,7 +197,9 @@ CLASS(EffectInfo, Object)
     FIELDS(MY)
     #undef MY
 
-    METHOD(EffectInfo, describe, string(EffectInfo this)) {
+    METHOD(EffectInfo, describe, string(EffectInfo this))
+    {
+        TC(EffectInfo, this);
         string s = sprintf("SUB(%s) {\n", this.effectinfo_name);
         #define str_bool(it) (it ? "true" : "false")
         #define str_float(it) ftos(it)
@@ -209,7 +211,9 @@ CLASS(EffectInfo, Object)
         return strcat(s, "}\n");
     }
 
-    METHOD(EffectInfo, dump, string(EffectInfo this)) {
+    METHOD(EffectInfo, dump, string(EffectInfo this))
+    {
+        TC(EffectInfo, this);
         string s = sprintf("effect %s\n", this.effectinfo_name);
         #define MY(f) this.effectinfo_##f
         #define p(k, isset, parse, unparse) if (isset) { s = strcat(s, "\t", #k, unparse, "\n"); }
index df062641a6126088cd15e84d732a9748d5448f6c..bea1b7b6fc9c5ab5ec674cd36027aaee1a8f2e1b 100644 (file)
@@ -854,6 +854,7 @@ float ball_customize()
 
 METHOD(BallStealer, wr_think, void(BallStealer thiswep, entity actor, .entity weaponentity, int fire))
 {
+    TC(BallStealer, thiswep);
     if(fire & 1)
         if(weapon_prepareattack(thiswep, actor, weaponentity, false, autocvar_g_balance_nexball_primary_refire))
             if(autocvar_g_nexball_basketball_meter)
@@ -883,18 +884,21 @@ METHOD(BallStealer, wr_think, void(BallStealer thiswep, entity actor, .entity we
     }
 }
 
-METHOD(BallStealer, wr_setup, void(BallStealer thiswep))
+METHOD(BallStealer, wr_setup, void(BallStealer this))
 {
+    TC(BallStealer, this);
     //weapon_setup(WEP_PORTO.m_id);
 }
 
-METHOD(BallStealer, wr_checkammo1, bool(BallStealer thiswep))
+METHOD(BallStealer, wr_checkammo1, bool(BallStealer this))
 {
+    TC(BallStealer, this);
     return true;
 }
 
-METHOD(BallStealer, wr_checkammo2, bool(BallStealer thiswep))
+METHOD(BallStealer, wr_checkammo2, bool(BallStealer this))
 {
+    TC(BallStealer, this);
     return true;
 }
 
index ba21efd96610624235ab8fadaee2fb31994f2c45..55f33ecc8ec3b97088ad18416563b798f7bbd9ad 100644 (file)
@@ -47,10 +47,16 @@ CLASS(GameItem, Object)
     ATTRIB(GameItem, m_color, vector, '1 1 1')
     ATTRIB(GameItem, m_waypoint, string, string_null)
     ATTRIB(GameItem, m_waypointblink, int, 1)
-    METHOD(GameItem, display, void(GameItem this, void(string name, string icon) returns)) {
+    METHOD(GameItem, display, void(GameItem this, void(string name, string icon) returns))
+    {
+        TC(GameItem, this);
         returns(this.m_name, this.m_icon ? sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.m_icon) : string_null);
     }
-    METHOD(GameItem, show, void(GameItem this)) { LOG_INFO("A game item\n"); }
+    METHOD(GameItem, show, void(GameItem this))
+    {
+        TC(GameItem, this);
+        LOG_INFO("A game item\n");
+    }
     void ITEM_HANDLE(Show, GameItem this) { this.show(this); }
 ENDCLASS(GameItem)
 
index 9bee4e6b2422d19ccd9c36810c4ca36a3cee23c8..08f7ff9c3d6b23c5c67cbfc6ee7595e9bd906625 100644 (file)
@@ -8,7 +8,11 @@ CLASS(Pickup, GameItem)
     ATTRIB(Pickup, m_sound, Sound, SND_ITEMPICKUP)
 #endif
     ATTRIB(Pickup, m_name, string, string_null)
-    METHOD(Pickup, show, void(Pickup this)) { LOG_INFOF("%s: %s\n", etos(this), this.m_name); }
+    METHOD(Pickup, show, void(Pickup this))
+    {
+        TC(Pickup, this);
+        LOG_INFOF("%s: %s\n", etos(this), this.m_name);
+    }
 #ifdef SVQC
     ATTRIB(Pickup, m_mins, vector, '-16 -16 0')
     ATTRIB(Pickup, m_maxs, vector, '16 16 32')
@@ -22,6 +26,7 @@ CLASS(Pickup, GameItem)
     float Item_GiveTo(entity item, entity player);
     METHOD(Pickup, giveTo, bool(Pickup this, entity item, entity player))
     {
+        TC(Pickup, this);
         bool b = Item_GiveTo(item, player);
         if (b) {
             LOG_TRACEF("entity %i picked up %s\n", player, this.m_name);
index ab7233ef269cd60db277aa23c81588a9260b83df..b7115ef552522fd2786a3749166430e9a7ae8ea8 100644 (file)
@@ -28,9 +28,15 @@ CLASS(Gametype, Object)
     ATTRIB(Gametype, m_mutators, string, string_null)
     ATTRIB(Gametype, m_parse_mapinfo, bool(string k, string v), func_null)
 
-    METHOD(Gametype, describe, string(entity this)) { return this.gametype_description; }
+    METHOD(Gametype, describe, string(Gametype this))
+    {
+        TC(Gametype, this);
+        return this.gametype_description;
+    }
 
-    METHOD(Gametype, display, void(entity this, void(string name, string icon) returns)) {
+    METHOD(Gametype, display, void(Gametype this, void(string name, string icon) returns))
+    {
+        TC(Gametype, this);
         returns(this.message, strcat("gametype_", this.mdl));
     }
 
index 3e9ebd2f120fc1ecd605611f6d3c6a1ad7a48936..1c34a2547ee07117b1f52d5707bbebd3b1c80eae 100644 (file)
@@ -11,7 +11,9 @@ CLASS(Model, Object)
         CONSTRUCT(Model);
         this.model_str = path;
     }
-    METHOD(Model, model_precache, void(entity this)) {
+    METHOD(Model, model_precache, void(Model this))
+    {
+        TC(Model, this);
         string s = this.model_str();
         if (s != "" && s != "null" && !fexists(s)) {
             LOG_WARNINGF("Missing model: \"%s\"\n", s);
index 22e2072c08c630a6087591acd456b83c5930fce5..f1a5ee3d46f473a558e67f4ac1ec7beb67789707 100644 (file)
@@ -56,17 +56,17 @@ CLASS(Monster, Object)
     ATTRIB(Monster, maxs, vector, '0 0 0')
 
     /** (SERVER) setup monster data */
-    METHOD(Monster, mr_setup, bool(Monster this, entity actor)) { return false; }
+    METHOD(Monster, mr_setup, bool(Monster this, entity actor)) { TC(Monster, this); return false; }
     /** (SERVER) logic to run every frame */
-    METHOD(Monster, mr_think, bool(Monster this, entity actor)) { return false; }
+    METHOD(Monster, mr_think, bool(Monster this, entity actor)) { TC(Monster, this); return false; }
     /** (SERVER) called when monster dies */
-    METHOD(Monster, mr_death, bool(Monster this, entity actor)) { return false; }
+    METHOD(Monster, mr_death, bool(Monster this, entity actor)) { TC(Monster, this); return false; }
     /** (BOTH) precaches models/sounds used by this monster */
-    METHOD(Monster, mr_precache, bool(Monster this)) { return false; }
+    METHOD(Monster, mr_precache, bool(Monster this)) { TC(Monster, this); return false; }
     /** (SERVER) called when monster is damaged */
-    METHOD(Monster, mr_pain, bool(Monster this, entity actor)) { return false; }
+    METHOD(Monster, mr_pain, bool(Monster this, entity actor)) { TC(Monster, this); return false; }
     /** (BOTH?) sets animations for monster */
-    METHOD(Monster, mr_anim, bool(Monster this, entity actor)) { return false; }
+    METHOD(Monster, mr_anim, bool(Monster this, entity actor)) { TC(Monster, this); return false; }
 
 ENDCLASS(Monster)
 
index 0bf1a835e048d91faf80e32e348d11d7106384b6..fcac1e4091434e898821c9cc350e8c7d3695e372 100644 (file)
@@ -42,7 +42,9 @@ REGISTER_WEAPON(MAGE_SPIKE, NEW(MageSpike));
 SOUND(MageSpike_FIRE, W_Sound("electro_fire"));
 void M_Mage_Attack_Spike(entity this, vector dir);
 void M_Mage_Attack_Push(entity this);
-METHOD(MageSpike, wr_think, void(MageSpike thiswep, entity actor, .entity weaponentity, int fire)) {
+METHOD(MageSpike, wr_think, void(MageSpike thiswep, entity actor, .entity weaponentity, int fire))
+{
+    TC(MageSpike, thiswep);
     if (fire & 1)
     if (!IS_PLAYER(actor) || weapon_prepareattack(thiswep, actor, weaponentity, false, 0.2)) {
         if (!actor.target_range) actor.target_range = autocvar_g_monsters_target_range;
@@ -65,6 +67,7 @@ CLASS(OffhandMageTeleport, OffhandWeapon)
     .bool OffhandMageTeleport_key_pressed;
     METHOD(OffhandMageTeleport, offhand_think, void(OffhandMageTeleport this, entity player, bool key_pressed))
     {
+        TC(OffhandMageTeleport, this);
         if (key_pressed && !player.OffhandMageTeleport_key_pressed)
                M_Mage_Attack_Teleport(player, player.enemy);
         player.OffhandMageTeleport_key_pressed = key_pressed;
@@ -411,6 +414,7 @@ spawnfunc(monster_mage) { Monster_Spawn(this, MON_MAGE.monsterid); }
 #ifdef SVQC
 METHOD(Mage, mr_think, bool(Mage thismon, entity actor))
 {
+    TC(Mage, thismon);
     bool need_help = false;
 
     FOREACH_ENTITY_FLOAT(iscreature, true,
@@ -441,21 +445,24 @@ METHOD(Mage, mr_think, bool(Mage thismon, entity actor))
     return true;
 }
 
-METHOD(Mage, mr_pain, bool(Mage thismon, entity actor))
+METHOD(Mage, mr_pain, bool(Mage this, entity actor))
 {
+    TC(Mage, this);
     return true;
 }
 
-METHOD(Mage, mr_death, bool(Mage thismon, entity actor))
+METHOD(Mage, mr_death, bool(Mage this, entity actor))
 {
+    TC(Mage, this);
     setanim(actor, actor.anim_die1, false, true, true);
     return true;
 }
 
 #endif
 #ifndef MENUQC
-METHOD(Mage, mr_anim, bool(Mage thismon, entity actor))
+METHOD(Mage, mr_anim, bool(Mage this, entity actor))
 {
+    TC(Mage, this);
     vector none = '0 0 0';
     actor.anim_die1 = animfixfps(actor, '4 1 0.5', none); // 2 seconds
     actor.anim_walk = animfixfps(actor, '1 1 1', none);
@@ -469,8 +476,9 @@ METHOD(Mage, mr_anim, bool(Mage thismon, entity actor))
 #ifdef SVQC
 .float speed;
 spawnfunc(item_health_large);
-METHOD(Mage, mr_setup, bool(Mage thismon, entity actor))
+METHOD(Mage, mr_setup, bool(Mage this, entity actor))
 {
+    TC(Mage, this);
     if(!actor.health) actor.health = (autocvar_g_monster_mage_health);
     if(!actor.speed) { actor.speed = (autocvar_g_monster_mage_speed_walk); }
     if(!actor.speed2) { actor.speed2 = (autocvar_g_monster_mage_speed_run); }
@@ -483,8 +491,9 @@ METHOD(Mage, mr_setup, bool(Mage thismon, entity actor))
     return true;
 }
 
-METHOD(Mage, mr_precache, bool(Mage thismon))
+METHOD(Mage, mr_precache, bool(Mage this))
 {
+    TC(Mage, this);
     return true;
 }
 #endif
index b091712791b9c5001aeed10841458cbd92872fe1..9f6fb8d1b2017d241bd648a42d3c4c452e762ce0 100644 (file)
@@ -225,27 +225,31 @@ spawnfunc(monster_shambler) { Monster_Spawn(this, MON_SHAMBLER.monsterid); }
 #endif // SVQC
 
 #ifdef SVQC
-METHOD(Shambler, mr_think, bool(Shambler thismon, entity actor))
+METHOD(Shambler, mr_think, bool(Shambler this, entity actor))
 {
+    TC(Shambler, this);
     return true;
 }
 
-METHOD(Shambler, mr_pain, bool(Shambler thismon, entity actor))
+METHOD(Shambler, mr_pain, bool(Shambler this, entity actor))
 {
+    TC(Shambler, this);
     actor.pain_finished = time + 0.5;
     setanim(actor, actor.anim_pain1, true, true, false);
     return true;
 }
 
-METHOD(Shambler, mr_death, bool(Shambler thismon, entity actor))
+METHOD(Shambler, mr_death, bool(Shambler this, entity actor))
 {
+    TC(Shambler, this);
     setanim(actor, actor.anim_die1, false, true, true);
     return true;
 }
 #endif
 #ifndef MENUQC
-METHOD(Shambler, mr_anim, bool(Shambler thismon, entity actor))
+METHOD(Shambler, mr_anim, bool(Shambler this, entity actor))
 {
+    TC(Shambler, this);
     vector none = '0 0 0';
     actor.anim_die1 = animfixfps(actor, '8 1 0.5', none); // 2 seconds
     actor.anim_walk = animfixfps(actor, '1 1 1', none);
@@ -262,8 +266,9 @@ METHOD(Shambler, mr_anim, bool(Shambler thismon, entity actor))
 #ifdef SVQC
 spawnfunc(item_health_mega);
 .float animstate_endtime;
-METHOD(Shambler, mr_setup, bool(Shambler thismon, entity actor))
+METHOD(Shambler, mr_setup, bool(Shambler this, entity actor))
 {
+    TC(Shambler, this);
     if(!actor.health) actor.health = (autocvar_g_monster_shambler_health);
     if(!actor.attack_range) actor.attack_range = 150;
     if(!actor.speed) { actor.speed = (autocvar_g_monster_shambler_speed_walk); }
@@ -282,8 +287,9 @@ METHOD(Shambler, mr_setup, bool(Shambler thismon, entity actor))
     return true;
 }
 
-METHOD(Shambler, mr_precache, bool(Shambler thismon))
+METHOD(Shambler, mr_precache, bool(Shambler this))
 {
+    TC(Shambler, this);
     return true;
 }
 #endif
index 512422d33b9c8227420106035d5b9e41991c3c9e..d85b855356a5d6fe580118f66a6494da4411c6d7 100644 (file)
@@ -88,7 +88,9 @@ MUTATOR_HOOKFUNCTION(spiderweb, MonsterSpawn)
 }
 
 SOUND(SpiderAttack_FIRE, W_Sound("electro_fire"));
-METHOD(SpiderAttack, wr_think, void(SpiderAttack thiswep, entity actor, .entity weaponentity, int fire)) {
+METHOD(SpiderAttack, wr_think, void(SpiderAttack thiswep, entity actor, .entity weaponentity, int fire))
+{
+    TC(SpiderAttack, thiswep);
     bool isPlayer = IS_PLAYER(actor);
     if (fire & 1)
     if ((!isPlayer && time >= actor.spider_web_delay) || weapon_prepareattack(thiswep, actor, weaponentity, false, autocvar_g_monster_spider_attack_web_delay)) {
@@ -215,26 +217,30 @@ spawnfunc(monster_spider) { Monster_Spawn(this, MON_SPIDER.monsterid); }
 #endif // SVQC
 
 #ifdef SVQC
-METHOD(Spider, mr_think, bool(Spider thismon, entity actor))
+METHOD(Spider, mr_think, bool(Spider this, entity actor))
 {
+    TC(Spider, this);
     return true;
 }
 
-METHOD(Spider, mr_pain, bool(Spider thismon, entity actor))
+METHOD(Spider, mr_pain, bool(Spider this, entity actor))
 {
+    TC(Spider, this);
     return true;
 }
 
-METHOD(Spider, mr_death, bool(Spider thismon, entity actor))
+METHOD(Spider, mr_death, bool(Spider this, entity actor))
 {
+    TC(Spider, this);
     setanim(actor, actor.anim_melee, false, true, true);
     actor.angles_x = 180;
     return true;
 }
 #endif
 #ifndef MENUQC
-METHOD(Spider, mr_anim, bool(Spider thismon, entity actor))
+METHOD(Spider, mr_anim, bool(Spider this, entity actor))
 {
+    TC(Spider, this);
     vector none = '0 0 0';
     actor.anim_walk = animfixfps(actor, '1 1 1', none);
     actor.anim_idle = animfixfps(actor, '0 1 1', none);
@@ -246,8 +252,9 @@ METHOD(Spider, mr_anim, bool(Spider thismon, entity actor))
 #endif
 #ifdef SVQC
 spawnfunc(item_health_medium);
-METHOD(Spider, mr_setup, bool(Spider thismon, entity actor))
+METHOD(Spider, mr_setup, bool(Spider this, entity actor))
 {
+    TC(Spider, this);
     if(!actor.health) actor.health = (autocvar_g_monster_spider_health);
     if(!actor.speed) { actor.speed = (autocvar_g_monster_spider_speed_walk); }
     if(!actor.speed2) { actor.speed2 = (autocvar_g_monster_spider_speed_run); }
@@ -260,8 +267,9 @@ METHOD(Spider, mr_setup, bool(Spider thismon, entity actor))
     return true;
 }
 
-METHOD(Spider, mr_precache, bool(Spider thismon))
+METHOD(Spider, mr_precache, bool(Spider this))
 {
+    TC(Spider, this);
     return true;
 }
 #endif
index fc13de40ffc314aa268794e00068ff9281c622fc..f6e9c1306effa86fc3d162a0652adfa888e60f72 100644 (file)
@@ -49,7 +49,9 @@ void M_Wyvern_Attack_Fireball_Explode();
 void M_Wyvern_Attack_Fireball_Touch();
 
 SOUND(WyvernAttack_FIRE, W_Sound("electro_fire"));
-METHOD(WyvernAttack, wr_think, void(WyvernAttack thiswep, entity actor, .entity weaponentity, int fire)) {
+METHOD(WyvernAttack, wr_think, void(WyvernAttack thiswep, entity actor, .entity weaponentity, int fire))
+{
+    TC(WyvernAttack, thiswep);
     if (fire & 1)
     if (time > actor.attack_finished_single[0] || weapon_prepareattack(thiswep, actor, weaponentity, false, 1.2)) {
         if (IS_PLAYER(actor)) W_SetupShot_Dir(actor, v_forward, false, 0, SND(WyvernAttack_FIRE), CH_WEAPON_B, 0);
@@ -78,7 +80,8 @@ METHOD(WyvernAttack, wr_think, void(WyvernAttack thiswep, entity actor, .entity
     }
 }
 
-METHOD(WyvernAttack, wr_checkammo1, bool(WyvernAttack thiswep)) {
+METHOD(WyvernAttack, wr_checkammo1, bool(WyvernAttack this)) {
+    TC(WyvernAttack, this);
        return true;
 }
 
@@ -143,20 +146,23 @@ spawnfunc(monster_wyvern) { Monster_Spawn(this, MON_WYVERN.monsterid); }
 #endif // SVQC
 
 #ifdef SVQC
-METHOD(Wyvern, mr_think, bool(Wyvern thismon, entity actor))
+METHOD(Wyvern, mr_think, bool(Wyvern this, entity actor))
 {
+    TC(Wyvern, this);
     return true;
 }
 
-METHOD(Wyvern, mr_pain, bool(Wyvern thismon, entity actor))
+METHOD(Wyvern, mr_pain, bool(Wyvern this, entity actor))
 {
+    TC(Wyvern, this);
     actor.pain_finished = time + 0.5;
     setanim(actor, actor.anim_pain1, true, true, false);
     return true;
 }
 
-METHOD(Wyvern, mr_death, bool(Wyvern thismon, entity actor))
+METHOD(Wyvern, mr_death, bool(Wyvern this, entity actor))
 {
+    TC(Wyvern, this);
     setanim(actor, actor.anim_die1, false, true, true);
     actor.velocity_x = -200 + 400 * random();
     actor.velocity_y = -200 + 400 * random();
@@ -165,8 +171,9 @@ METHOD(Wyvern, mr_death, bool(Wyvern thismon, entity actor))
 }
 #endif
 #ifndef MENUQC
-METHOD(Wyvern, mr_anim, bool(Wyvern thismon, entity actor))
+METHOD(Wyvern, mr_anim, bool(Wyvern this, entity actor))
 {
+    TC(Wyvern, this);
     vector none = '0 0 0';
     actor.anim_die1 = animfixfps(actor, '4 1 0.5', none); // 2 seconds
     actor.anim_walk = animfixfps(actor, '1 1 1', none);
@@ -179,8 +186,9 @@ METHOD(Wyvern, mr_anim, bool(Wyvern thismon, entity actor))
 #endif
 #ifdef SVQC
 spawnfunc(item_cells);
-METHOD(Wyvern, mr_setup, bool(Wyvern thismon, entity actor))
+METHOD(Wyvern, mr_setup, bool(Wyvern this, entity actor))
 {
+    TC(Wyvern, this);
     if(!actor.health) actor.health = (autocvar_g_monster_wyvern_health);
     if(!actor.speed) { actor.speed = (autocvar_g_monster_wyvern_speed_walk); }
     if(!actor.speed2) { actor.speed2 = (autocvar_g_monster_wyvern_speed_run); }
@@ -193,8 +201,9 @@ METHOD(Wyvern, mr_setup, bool(Wyvern thismon, entity actor))
     return true;
 }
 
-METHOD(Wyvern, mr_precache, bool(Wyvern thismon))
+METHOD(Wyvern, mr_precache, bool(Wyvern this))
 {
+    TC(Wyvern, this);
     return true;
 }
 #endif
index 9163aaf071e5f9dea4f2d6f920abf43584d2a51e..b28bb8d84eaefa6fbb194bd293b35e48cc992702 100644 (file)
@@ -155,22 +155,25 @@ spawnfunc(monster_zombie) { Monster_Spawn(this, MON_ZOMBIE.monsterid); }
 #endif // SVQC
 
 #ifdef SVQC
-METHOD(Zombie, mr_think, bool(Zombie thismon, entity actor))
+METHOD(Zombie, mr_think, bool(Zombie this, entity actor))
 {
+    TC(Zombie, this);
     if(time >= actor.spawn_time)
         actor.damageforcescale = autocvar_g_monster_zombie_damageforcescale;
     return true;
 }
 
-METHOD(Zombie, mr_pain, bool(Zombie thismon, entity actor))
+METHOD(Zombie, mr_pain, bool(Zombie this, entity actor))
 {
+    TC(Zombie, this);
     actor.pain_finished = time + 0.34;
     setanim(actor, ((random() > 0.5) ? actor.anim_pain1 : actor.anim_pain2), true, true, false);
     return true;
 }
 
-METHOD(Zombie, mr_death, bool(Zombie thismon, entity actor))
+METHOD(Zombie, mr_death, bool(Zombie this, entity actor))
 {
+    TC(Zombie, this);
     actor.armorvalue = autocvar_g_monsters_armor_blockpercent;
 
     setanim(actor, ((random() > 0.5) ? actor.anim_die1 : actor.anim_die2), false, true, true);
@@ -178,8 +181,9 @@ METHOD(Zombie, mr_death, bool(Zombie thismon, entity actor))
 }
 #endif
 #ifndef MENUQC
-METHOD(Zombie, mr_anim, bool(Zombie thismon, entity actor))
+METHOD(Zombie, mr_anim, bool(Zombie this, entity actor))
 {
+    TC(Zombie, this);
     vector none = '0 0 0';
     actor.anim_die1 = animfixfps(actor, '9 1 0.5', none); // 2 seconds
     actor.anim_die2 = animfixfps(actor, '12 1 0.5', none); // 2 seconds
@@ -199,8 +203,9 @@ METHOD(Zombie, mr_anim, bool(Zombie thismon, entity actor))
 }
 #endif
 #ifdef SVQC
-METHOD(Zombie, mr_setup, bool(Zombie thismon, entity actor))
+METHOD(Zombie, mr_setup, bool(Zombie this, entity actor))
 {
+    TC(Zombie, this);
     if(!actor.health) actor.health = (autocvar_g_monster_zombie_health);
     if(!actor.speed) { actor.speed = (autocvar_g_monster_zombie_speed_walk); }
     if(!actor.speed2) { actor.speed2 = (autocvar_g_monster_zombie_speed_run); }
@@ -223,8 +228,9 @@ METHOD(Zombie, mr_setup, bool(Zombie thismon, entity actor))
     return true;
 }
 
-METHOD(Zombie, mr_precache, bool(Zombie thismon))
+METHOD(Zombie, mr_precache, bool(Zombie this))
 {
+    TC(Zombie, this);
     return true;
 }
 #endif
index 7225cef825ccb4ef2df20c0f4911542a88f37f2e..a462861f29b8401452b3c1d75becd2a4de24e555 100644 (file)
@@ -120,8 +120,9 @@ CLASS(Sound, Object)
                return string_null;
 #endif
        }
-       METHOD(Sound, sound_precache, void(entity this))
+       METHOD(Sound, sound_precache, void(Sound this))
        {
+           TC(Sound, this);
                string s = Sound_fixpath(this);
                if (!s) return;
                LOG_DEBUGF("precache_sound(\"%s\")\n", s);
index 90c7029e357be1152f3fd85db8cc342d7c3b9b22..4e80bfd2cd971338acba75cf50b55de0d9e74859 100644 (file)
@@ -17,6 +17,7 @@ CLASS(PlayerState, Object)
        ATTRIB(PlayerState, m_weapon, Weapon, Weapons_from(-1))
        METHOD(PlayerState, ps_push, void(PlayerState this, entity cl))
        {
+           TC(PlayerState, this);
                STAT(ACTIVEWEAPON, cl) = this.m_weapon.m_id;
                STAT(SWITCHINGWEAPON, cl) = this.m_switchingweapon.m_id;
                STAT(SWITCHWEAPON, cl) = this.m_switchweapon.m_id;
index 637dbe92423c36a3546ba9145a6cf25597577e62..4615ea970cd7b64bb210f03ad2218f6b03cda8a4 100644 (file)
@@ -241,6 +241,7 @@ CLASS(Object, );
     #define remove(this) delete(this)
        METHOD(Object, describe, string(Object this))
        {
+           TC(Object, this);
                string s = _("No description");
                if (cvar("developer"))
                {
@@ -254,6 +255,7 @@ CLASS(Object, );
        }
        METHOD(Object, display, void(Object this, void(string name, string icon) returns))
        {
+           TC(Object, this);
                returns(sprintf("entity %i", this), "nopreview_map");
        }
 ENDCLASS(Object)
index 5add6184e0037fbff1bce625f6d5c84b87eb22ea..cde5ef367abedccba08a358e74ff7c4c7014dd21 100644 (file)
@@ -12,7 +12,7 @@ REGISTRY_SORT(SERVER_COMMANDS)
        ATTRIB(servercommand_##id, m_description, string, description); \
        ENDCLASS(servercommand_##id) \
     REGISTER(SERVER_COMMANDS, CMD_SV, id, m_id, NEW(servercommand_##id)); \
-       METHOD(servercommand_##id, m_invokecmd, void(int request, entity caller, int arguments, string command))
+       METHOD(servercommand_##id, m_invokecmd, void(servercommand_##id this, int request, entity caller, int arguments, string command))
 
 STATIC_INIT(SERVER_COMMANDS_aliases) {
        FOREACH(SERVER_COMMANDS, true, LAMBDA(localcmd(sprintf("alias %1$s \"%2$s %1$s ${* ?}\"\n", it.m_name, "qc_cmd_sv"))));
index 2524d31e48256de2a7173d7c2f7bd0d826d2f0aa..b79a570209ff46f7c0f2a10f73634443034cc0d3 100644 (file)
@@ -12,7 +12,7 @@ REGISTRY_SORT(COMMON_COMMANDS)
        ATTRIB(commoncommand_##id, m_description, string, description); \
        ENDCLASS(commoncommand_##id) \
     REGISTER(COMMON_COMMANDS, CMD_SV, id, m_id, NEW(commoncommand_##id)); \
-       METHOD(commoncommand_##id, m_invokecmd, void(int request, entity caller, int arguments, string command))
+       METHOD(commoncommand_##id, m_invokecmd, void(commoncommand_##id this, int request, entity caller, int arguments, string command))
 
 STATIC_INIT(COMMON_COMMANDS_aliases) {
        FOREACH(COMMON_COMMANDS, true, LAMBDA(localcmd(sprintf("alias %1$s \"%2$s %1$s ${* ?}\"\n", it.m_name, "qc_cmd_svcmd"))));
@@ -165,7 +165,7 @@ float CommonCommand_macro_command(float argc, entity caller, string command)
 {
        string c = strtolower(argv(0));
        FOREACH(COMMON_COMMANDS, it.m_name == c, LAMBDA(
-               it.m_invokecmd(CMD_REQUEST_COMMAND, caller, argc, command);
+               it.m_invokecmd(it, CMD_REQUEST_COMMAND, caller, argc, command);
                return true;
        ));
        return false;
@@ -175,7 +175,7 @@ float CommonCommand_macro_usage(float argc, entity caller)
 {
        string c = strtolower(argv(1));
        FOREACH(COMMON_COMMANDS, it.m_name == c, LAMBDA(
-               it.m_invokecmd(CMD_REQUEST_USAGE, caller, argc, "");
+               it.m_invokecmd(it, CMD_REQUEST_USAGE, caller, argc, "");
                return true;
        ));
        return false;
index 2f1400245083fafea22aaeed9f5863fb0de4dd2e..b48844d20dd780420cf0ad3ede27ffbf5691a3b5 100644 (file)
@@ -1781,7 +1781,7 @@ float GameCommand_macro_command(float argc, string command)
 {
        string c = strtolower(argv(0));
        FOREACH(SERVER_COMMANDS, it.m_name == c, LAMBDA(
-               it.m_invokecmd(CMD_REQUEST_COMMAND, NULL, argc, command);
+               it.m_invokecmd(it, CMD_REQUEST_COMMAND, NULL, argc, command);
                return true;
        ));
        return false;
@@ -1791,7 +1791,7 @@ float GameCommand_macro_usage(float argc)
 {
        string c = strtolower(argv(1));
        FOREACH(SERVER_COMMANDS, it.m_name == c, LAMBDA(
-               it.m_invokecmd(CMD_REQUEST_USAGE, NULL, argc, "");
+               it.m_invokecmd(it, CMD_REQUEST_USAGE, NULL, argc, "");
                return true;
        ));
        return false;