]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
move freezetag specific damage/force code into a PlayerDamage hook, fix the mapinfo...
authorFruitieX <fruitiex@gmail.com>
Tue, 30 Nov 2010 14:33:53 +0000 (16:33 +0200)
committerFruitieX <fruitiex@gmail.com>
Tue, 30 Nov 2010 14:33:53 +0000 (16:33 +0200)
qcsrc/menu/xonotic/dialog_multiplayer_create_mapinfo.c
qcsrc/server/g_damage.qc
qcsrc/server/mutators/gamemode_freezetag.qc

index 467357810c005b050953b8f34192d727e7c27f82..10bd56bf34f084c7a0486f9abbe7763a38cf4b58 100644 (file)
@@ -28,6 +28,7 @@ CLASS(XonoticMapInfoDialog) EXTENDS(XonoticDialog)
        ATTRIB(XonoticMapInfoDialog, typeRaceLabel, entity, NULL)
        ATTRIB(XonoticMapInfoDialog, typeCTSLabel, entity, NULL)
        ATTRIB(XonoticMapInfoDialog, typeNexballLabel, entity, NULL)
+       ATTRIB(XonoticMapInfoDialog, typeFreezetagLabel, entity, NULL)
 
        ATTRIB(XonoticMapInfoDialog, currentMapIndex, float, 0)
        ATTRIB(XonoticMapInfoDialog, currentMapBSPName, string, string_null)
@@ -83,6 +84,7 @@ void XonoticMapInfoDialog_loadMapInfo(entity me, float i, entity mlb)
        me.typeRaceLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_RACE);
        me.typeCTSLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_CTS);
        me.typeNexballLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_NEXBALL);
+       me.typeFreezetagLabel.disabled = !(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_FREEZETAG);
 
        MapInfo_ClearTemps();
 }
index 7af3a866ab5bb9006ae0db717ebdad98b7a414f9..cde87fec1791e028dc3b09e94f4fa4123d9912d4 100644 (file)
@@ -528,15 +528,6 @@ void Damage (entity targ, entity inflictor, entity attacker, float damage, float
                if (attacker.isbot)
                        damage = damage * bound(0.1, (skill + 5) * 0.1, 1);
 
-               if(g_freezetag)
-               {
-                       if(targ.freezetag_frozen == 1)
-                       {
-                               damage = 0;
-                               force = force * cvar("g_freezetag_frozen_force");
-                       }
-               }
-
                // nullify damage if teamplay is on
                if(deathtype != DEATH_TELEFRAG)
                if(attacker.classname == "player")
index 668215850722da699035ace7ea9679e803697bab..7ecde3694025e5e3dfdf8c1cc9ee91dec112def8 100644 (file)
@@ -257,6 +257,20 @@ MUTATOR_HOOKFUNCTION(freezetag_PlayerPhysics)
        return 1;
 }
 
+MUTATOR_HOOKFUNCTION(freezetag_PlayerDamage)
+{
+    if(g_freezetag)
+    {
+        if(frag_target.freezetag_frozen == 1)
+        {
+            damage_take = 0;
+            damage_save = 0;
+            damage_force = damage_force * cvar("g_freezetag_frozen_force");
+        }
+    }
+    return 1;
+}
+
 MUTATOR_DEFINITION(gamemode_freezetag)
 {
        MUTATOR_HOOK(MakePlayerObserver, freezetag_RemovePlayer, CBC_ORDER_ANY);
@@ -266,6 +280,7 @@ MUTATOR_DEFINITION(gamemode_freezetag)
        MUTATOR_HOOK(GiveFragsForKill, freezetag_GiveFragsForKill, CBC_ORDER_FIRST);
        MUTATOR_HOOK(PlayerPreThink, freezetag_PlayerPreThink, CBC_ORDER_FIRST);
        MUTATOR_HOOK(PlayerPhysics, freezetag_PlayerPhysics, CBC_ORDER_FIRST);
+       MUTATOR_HOOK(PlayerDamage, freezetag_PlayerDamage, CBC_ORDER_ANY);
 
        MUTATOR_ONADD
        {