]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Remove some unused code
authorMario <mario.mario@y7mail.com>
Thu, 29 Aug 2013 09:48:41 +0000 (19:48 +1000)
committerMario <mario.mario@y7mail.com>
Thu, 29 Aug 2013 09:48:41 +0000 (19:48 +1000)
19 files changed:
commands.cfg
defaultXonotic.cfg
models/td/barricade.md3 [deleted file]
qcsrc/client/scoreboard.qc
qcsrc/common/constants.qh
qcsrc/server/cl_weaponsystem.qc
qcsrc/server/command/cmd.qc
qcsrc/server/command/sv_cmd.qc
qcsrc/server/g_damage.qc
qcsrc/server/mutators/gamemode_ctf.qc
qcsrc/server/mutators/gamemode_freezetag.qc
qcsrc/server/tturrets/system/system_damage.qc
qcsrc/server/tturrets/system/system_main.qc
qcsrc/server/tturrets/units/unit_fusionreactor.qc
qcsrc/server/tturrets/units/unit_walker.qc
scripts/barricade.shader [deleted file]
scripts/shaderlist.txt
textures/barricade.tga [deleted file]
textures/barricade_norm.tga [deleted file]

index 9cbad2a63544d3bb077fc31c2359811f1cc056bc..ee71c70f37b70ed4c4691e99e8d2fec3b1321d6a 100644 (file)
@@ -56,6 +56,7 @@ alias who                  "qc_cmd_svcmd  who                  ${* ?}" // Displa
 // generic commands (across all programs)
 alias addtolist            "qc_cmd_svmenu addtolist            ${* ?}" // Add a string to a cvar
 alias dumpcommands         "qc_cmd_svmenu dumpcommands         ${* ?}" // Dump all commands on the program to *_cmd_dump.txt
+alias dumpmonsters         "qc_cmd_svmenu dumpmonsters         ${* ?}" // Dump all monsters into monsters_dump.txt
 alias dumpnotifs           "qc_cmd_svcl   dumpnotifs           ${* ?}" // Dump all notifications into notifications_dump.txt
 alias maplist              "qc_cmd_svmenu maplist              ${* ?}" // Automatic control of maplist
 alias nextframe            "qc_cmd_svmenu nextframe            ${* ?}" // Execute the given command next frame of this VM
@@ -178,10 +179,6 @@ alias spec "spectate"
 
 // mutator aliases
 alias sandbox "cmd g_sandbox ${* ?}"
-alias spawnturret "cmd turretspawn ${* ?}"
-alias upgradeturret "cmd buffturret ${* ?}"
-alias rmturret "cmd turretremove ${* ?}"
-alias repairturret "cmd repairturret ${* ?}"
 
 
 // ============================================================
@@ -193,7 +190,7 @@ alias allspec              "qc_cmd_sv     allspec              ${* ?}" // Force
 alias anticheat            "qc_cmd_sv     anticheat            ${* ?}" // Create an anticheat report for a client
 alias bbox                 "qc_cmd_sv     bbox                 ${* ?}" // Print detailed information about world size
 alias bot_cmd              "qc_cmd_sv     bot_cmd              ${* ?}" // Control and send commands to bots
-alias butcher                     "qc_cmd_sv     butcher                          ${* ?}" // Remove all monsters on the map
+alias butcher              "qc_cmd_sv     butcher              ${* ?}" // Remove all monsters on the map
 alias cointoss             "qc_cmd_sv     cointoss             ${* ?}" // Flip a virtual coin and give random result
 alias database             "qc_cmd_sv     database             ${* ?}" // Extra controls of the serverprogs database
 alias defer_clear          "qc_cmd_sv     defer_clear          ${* ?}" // Clear all queued defer commands for a specific client
index 9d5b9f4d6975bb7a30df5c60fbc0b1a0ed94a2d0..1520b128478351e4f199557029bb79769971cf7c 100644 (file)
@@ -430,8 +430,6 @@ seta menu_monsters_edit_skin 0
 seta menu_monsters_edit_color ""
 seta menu_monsters_edit_movetarget 1
 
-seta menu_td_edit_spawn ""
-
 set g_playerclip_collisions 1 "0 = disable collision testing against playerclips, might be useful on some defrag maps"
 set g_botclip_collisions 1 "0 = disable collision testing against botclips, might be useful on some defrag maps"
 
diff --git a/models/td/barricade.md3 b/models/td/barricade.md3
deleted file mode 100644 (file)
index 8d58d9b..0000000
Binary files a/models/td/barricade.md3 and /dev/null differ
index 104c44252ce34cf2cb1de40c2e50978b2ea4a5d9..14e0dbc6705c4c6e8ca3e786cffb9023018dbfa9 100644 (file)
@@ -1069,15 +1069,10 @@ vector HUD_DrawKeyValue(vector pos, string key, string value) {
 
 vector HUD_DrawMapStats(vector pos, vector rgb, vector bg_size) {
        float stat_secrets_found, stat_secrets_total;
-       float stat_current_wave, stat_totalwaves;
        float stat_monsters_killed, stat_monsters_total;
        float rows = 0;
        string val;
        
-       // get tower defense stats
-       stat_current_wave = getstatf(STAT_CURRENT_WAVE);
-       stat_totalwaves = getstatf(STAT_TOTALWAVES);
-       
        // get monster stats
        stat_monsters_killed = getstatf(STAT_MONSTERS_KILLED);
        stat_monsters_total = getstatf(STAT_MONSTERS_TOTAL);
@@ -1113,13 +1108,6 @@ vector HUD_DrawMapStats(vector pos, vector rgb, vector bg_size) {
                drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
        drawborderlines(autocvar_scoreboard_border_thickness, pos, tmp, '0 0 0', scoreboard_alpha_bg * 0.75, DRAWFLAG_NORMAL);
        
-       // draw waves
-       if(stat_totalwaves)
-       {
-               val = sprintf("%d/%d", stat_current_wave, stat_totalwaves);
-               pos = HUD_DrawKeyValue(pos, _("Current wave:"), val);
-       }
-       
        // draw monsters
        if(stat_monsters_total)
        {
index 22ba6a56fe84332a222d063407a79ddb37c7bbe7..74f3da07933f06e5fe5b6b076a09010f18694058 100644 (file)
@@ -182,11 +182,8 @@ const float STAT_SECRETS_FOUND = 71;
 const float STAT_RESPAWN_TIME = 72;
 const float STAT_ROUNDSTARTTIME = 73;
 
-const float STAT_CURRENT_WAVE = 73;
-const float STAT_TOTALWAVES = 74;
-
-const float STAT_MONSTERS_TOTAL = 75;
-const float STAT_MONSTERS_KILLED = 76;
+const float STAT_MONSTERS_TOTAL = 73;
+const float STAT_MONSTERS_KILLED = 74;
 
 // mod stats (1xx)
 const float STAT_REDALIVE = 100;
index 2b99630d5874f650852318bb47072f6b2b7c7607..81a4f5a7ef895e4a704b91b9a02ea9c0aad4436a 100644 (file)
@@ -88,7 +88,7 @@ void W_HitPlotAnalysis(entity player, vector screenforward, vector screenright,
        vector org;
        float lag;
 
-       if(player.hitplotfh >= 0 && !(player.flags & FL_MONSTER))
+       if(player.hitplotfh >= 0)
        {
                lag = ANTILAG_LATENCY(player);
                if(lag < 0.001)
@@ -1017,8 +1017,6 @@ vector W_CalculateProjectileVelocity(vector pvelocity, vector mvelocity, float f
 
 void W_AttachToShotorg(entity flash, vector offset)
 {
-       if(self.flags & FL_MONSTER)
-               return; // no flash for monsters
        entity xflash;
        flash.owner = self;
        flash.angles_z = random() * 360;
@@ -1282,9 +1280,6 @@ void W_SetupProjectileVelocity(entity missile, float pSpeed, float spread)
 
 void W_DecreaseAmmo(.float ammo_type, float ammo_use, float ammo_reload)
 {
-       if(self.flags & FL_MONSTER) // no ammo for monsters... yet
-               return;
-               
        if((self.items & IT_UNLIMITED_WEAPON_AMMO) && !ammo_reload)
                return;
 
index ce049adf305e31d93ec3fc8b37ddf651c978440a..68b1457fcb5291b93d658afea5c0ab0df127e893 100644 (file)
@@ -196,7 +196,7 @@ void ClientCommand_mobedit(float request, float argc)
                        
                        switch(argv(1))
                        {
-                               case "name": trace_ent.netname = strzone(strdecolorize(argv(2))); if(trace_ent.sprite) WaypointSprite_UpdateSprites(trace_ent.sprite, trace_ent.netname, "", ""); return;
+                               case "name": trace_ent.monster_name = strzone(strdecolorize(argv(2))); if(trace_ent.sprite) WaypointSprite_UpdateSprites(trace_ent.sprite, trace_ent.monster_name, "", ""); return;
                                case "skin": if(trace_ent.monsterid != MON_MAGE) { trace_ent.skin = stof(argv(2)); trace_ent.SendFlags |= MSF_STATUS; } return;
                                case "movetarget": trace_ent.monster_moveflags = stof(argv(2)); return;
                        }
@@ -228,7 +228,7 @@ void ClientCommand_mobkill(float request)
                                        sprint(self, "That monster does not belong to you.\n");
                                        return;
                                }
-                               sprint(self, strcat("Your pet '", trace_ent.netname, "' has been brutally mutilated.\n"));
+                               sprint(self, strcat("Your pet '", trace_ent.monster_name, "' has been brutally mutilated.\n"));
                                Damage (trace_ent, world, world, trace_ent.health + trace_ent.max_health + 200, DEATH_KILL, trace_ent.origin, '0 0 0');
                                return;
                        }
index 2175ceb42850984524ff52217a4de022a856c6fa..508dd1786045da0715a2cc54b7eb59a8189a01b7 100644 (file)
@@ -149,21 +149,21 @@ void GameCommand_butcher(float request)
                        if(g_invasion) { print("This command doesn't work during an invasion.\n"); return; }
                
             float removed_count = 0;
-                       entity montokill, head;
+                       entity head;
                        
-            FOR_EACH_MONSTER(montokill)
-            {
-                               WaypointSprite_Kill(montokill.sprite);
+                       FOR_EACH_MONSTER(head)
+                       {
+                               WaypointSprite_Kill(head.sprite);
                                
-                               if(montokill.weaponentity)
-                                       remove(montokill.weaponentity);
+                               if(head.weaponentity)
+                                       remove(head.weaponentity);
+                                       
+                               if(head.iceblock)
+                                       remove(head.iceblock);
                                        
-                               if(montokill.iceblock)
-                                       remove(montokill.iceblock);
-                    
-                remove(montokill);
-                removed_count += 1;
-            }
+                               remove(head);
+                               ++removed_count;
+                       }
                        
                        FOR_EACH_PLAYER(head)
                                head.monstercount = 0;
@@ -1780,7 +1780,7 @@ void GameCommand_(float request)
 // Do not hard code aliases for these, instead create them in commands.cfg... also: keep in alphabetical order, please ;)
 #define SERVER_COMMANDS(request,arguments,command) \
        SERVER_COMMAND("adminmsg", GameCommand_adminmsg(request, arguments), "Send an admin message to a client directly") \
-       SERVER_COMMAND("butcher", GameCommand_butcher(request), "Instantly removes all monsters on the map") \
+       SERVER_COMMAND("butcher", GameCommand_butcher(request), "Instantly removes all monsters on the map") \
        SERVER_COMMAND("allready", GameCommand_allready(request), "Restart the server and reset the players") \
        SERVER_COMMAND("allspec", GameCommand_allspec(request, arguments), "Force all players to spectate") \
        SERVER_COMMAND("anticheat", GameCommand_anticheat(request, arguments), "Create an anticheat report for a client") \
index 2e100f2ce10fb25b044d9f6afbcc2e66908d7574..56cac627f5c7e7be76a72e57567f663fc005b7b3 100644 (file)
@@ -552,10 +552,7 @@ void Ice_Think()
 
 void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypoint)
 {
-       float monster = (targ.flags & FL_MONSTER);
-       float player = (targ.flags & FL_CLIENT);
-       
-       if(!player && !monster) // only specified entities can be freezed
+       if(!IS_PLAYER(targ) && !(targ.flags & FL_MONSTER)) // only specified entities can be freezed
                return;
                
        if(targ.frozen)
@@ -595,18 +592,19 @@ void Freeze (entity targ, float freeze_time, float frozen_type, float show_waypo
 
 void Unfreeze (entity targ)
 {
-       if not(targ.frozen)
-               return; // not even frozen?
-               
+       if(targ.frozen) // only reset health if target was frozen
+               targ.health = ((IS_PLAYER(targ)) ? autocvar_g_balance_health_start : targ.max_health);
        targ.frozen = 0;
        targ.revive_progress = 0;
-       targ.health = ((targ.classname == STR_PLAYER) ? autocvar_g_balance_health_start : targ.max_health);
        
        WaypointSprite_Kill(targ.waypointsprite_attached);
 
        // remove the ice block
-       remove(targ.iceblock);
-       targ.iceblock = world;
+       if(targ.iceblock)
+       {
+               remove(targ.iceblock);
+               targ.iceblock = world;
+       }
 }
 
 // these are updated by each Damage call for use in button triggering and such
index 3ff0fc96c5609ee0541390c7fdc8fa4c7ca83a9b..f4d1c31cf3e3c276797933ebb92420774737f524 100644 (file)
@@ -814,8 +814,6 @@ void ctf_FlagTouch()
        
        entity toucher = other;
        
-       if(toucher.frozen) { return; }
-       
        // automatically kill the flag and return it if it touched lava/slime/nodrop surfaces
        if(ITEM_TOUCH_NEEDKILL())
        {
@@ -825,7 +823,8 @@ void ctf_FlagTouch()
        }
        
        // special touch behaviors
-       if(toucher.vehicle_flags & VHF_ISVEHICLE)
+       if(toucher.frozen) { return; }
+       else if(toucher.vehicle_flags & VHF_ISVEHICLE)
        {
                if(autocvar_g_ctf_allow_vehicle_touch)
                        toucher = toucher.owner; // the player is actually the vehicle owner, not other
index ead918c4498f2230baa916b1435a3f1fc1219a94..95c384919955926f6517cb037c5e423af98cd380 100644 (file)
@@ -406,9 +406,9 @@ MUTATOR_HOOKFUNCTION(freezetag_PlayerPreThink)
                n = 0;
                FOR_EACH_PLAYER(other) if(self != other)
                {
-                       if(!other.frozen)
+                       if(other.frozen == 0)
                        {
-                               if(other.team == self.team)
+                               if(!IsDifferentTeam(other, self))
                                {
                                        if(boxesoverlap(self.absmin - revive_extra_size, self.absmax + revive_extra_size, other.absmin, other.absmax))
                                        {
index d561862d0f2412e77f4f55f851d969f4ef1cbded..837f50a074986b0b35bae962f83e8b8de2a68652 100644 (file)
@@ -66,7 +66,6 @@ void turret_stdproc_respawn()
     self.tur_head.avelocity     = self.avelocity;
     self.tur_head.angles        = self.idle_aim;
     self.health                 = self.tur_health;
-       self.max_health                         = self.tur_health;
 
     self.enemy                  = world;
     self.volly_counter          = self.shot_volly;
index b5dfba6a9b7c891659a22ec902c513ba25502615..5763e888f9de9b0993b80806274b3a2ab876494f 100644 (file)
@@ -1110,7 +1110,6 @@ float turret_stdproc_init (string cvar_base_name, string base, string head, floa
     if not (self.health)
         self.health = 1000;
     self.tur_health = max(1, self.health);
-       self.max_health = self.tur_health;
        self.bot_attack = TRUE;
     self.monster_attack = TRUE;
 
index 5268ff0546fe6a2ae8d73f600b6b9ab093c642ce..5954384b2541d713cee56ad82c04726f5d5339b1 100644 (file)
@@ -46,7 +46,7 @@ float turret_fusionreactor_firecheck()
        if (self.enemy.ammo >= self.enemy.ammo_max)
                return 0;
        
-       if(teamplay && IsDifferentTeam(self, self.enemy))
+       if(IsDifferentTeam(self, self.enemy))
                return 0;
        
        if not (self.enemy.ammo_flags & TFL_AMMO_ENERGY)
index 3511a2dcd217ed8680f80b660a40b30021a7aeb4..20100de047203368a5d11e5a520a8cd8cdb39e11 100644 (file)
@@ -107,7 +107,7 @@ void walker_rocket_think()
     m_speed = vlen(self.velocity);
 
     // Enemy dead? just keep on the current heading then.
-    if (self.enemy == world || self.enemy.deadflag != DEAD_NO || self.enemy.classname == "td_generator")
+    if (self.enemy == world || self.enemy.deadflag != DEAD_NO)
         self.enemy = world;
 
     if (self.enemy)
diff --git a/scripts/barricade.shader b/scripts/barricade.shader
deleted file mode 100644 (file)
index c650b5b..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-barricade
-{
- cull none
- {
-       map textures/barricade.tga
- }
-}
-
index 831a6673f240b991e39c6f30d214ea281d0a4c23..ce11875b7ba04f75bb4eb280631d09b142885f2d 100644 (file)
@@ -14,6 +14,5 @@ tree
 tuba
 turrets
 weapons
-barricade
 monsters
 ok_nade_counter
diff --git a/textures/barricade.tga b/textures/barricade.tga
deleted file mode 100644 (file)
index d9cd774..0000000
Binary files a/textures/barricade.tga and /dev/null differ
diff --git a/textures/barricade_norm.tga b/textures/barricade_norm.tga
deleted file mode 100644 (file)
index e664ed4..0000000
Binary files a/textures/barricade_norm.tga and /dev/null differ