r3399 - trunk/data/qcsrc/server
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Thu Feb 21 21:10:08 EST 2008
Author: lordhavoc
Date: 2008-02-21 21:10:03 -0500 (Thu, 21 Feb 2008)
New Revision: 3399
Modified:
trunk/data/qcsrc/server/bots.qc
trunk/data/qcsrc/server/g_world.qc
Log:
restore bot preferred colors at the end of each level, so if teamplay
changed their colors they will revert to their preferred colors for the
next level
Modified: trunk/data/qcsrc/server/bots.qc
===================================================================
--- trunk/data/qcsrc/server/bots.qc 2008-02-22 02:07:30 UTC (rev 3398)
+++ trunk/data/qcsrc/server/bots.qc 2008-02-22 02:10:03 UTC (rev 3399)
@@ -1317,6 +1317,8 @@
float sv_maxspeed;
.float createdtime;
+.float bot_preferredcolors;
+
.float bot_attack;
.float bot_dodge;
.float bot_dodgerating;
@@ -1416,6 +1418,7 @@
//shirt = bound(0, floor(random() * 16), 15);
shirt = pants;
self.clientcolors = shirt * 16 + pants;
+ self.bot_preferredcolors = self.clientcolors;
self.team = pants + 1;
// now pick a name...
@@ -1469,6 +1472,18 @@
self.netname = name;
};
+void() bot_endgame =
+{
+ local entity e;
+ e = bot_list;
+ while (e)
+ {
+ e.clientcolors = e.bot_preferredcolors;
+ e = e.nextbot;
+ }
+ // if dynamic waypoints are ever implemented, save them here
+};
+
float bot_ignore_bots; // let bots not attack other bots (only works in non-teamplay)
float(entity e) bot_shouldattack =
{
Modified: trunk/data/qcsrc/server/g_world.qc
===================================================================
--- trunk/data/qcsrc/server/g_world.qc 2008-02-22 02:07:30 UTC (rev 3398)
+++ trunk/data/qcsrc/server/g_world.qc 2008-02-22 02:10:03 UTC (rev 3399)
@@ -1147,8 +1147,8 @@
else
{
SetWinners(team, COLOR_TEAM1);
- }
-
+ }
+
local entity ent;
ent = find(world, classname, "target_assault_roundend");
if(ent)
@@ -1174,7 +1174,7 @@
cvar_set("timelimit", ftos((2*time)/60));
assault_new_round();
}
- }
+ }
}
return status;
@@ -1848,7 +1848,7 @@
mapvote_count = 0;
mapvote_detail = !cvar("g_maplist_votable_nodetail");
mapvote_abstain = cvar("g_maplist_votable_abstain");
-
+
if(mapvote_abstain)
nmax = min(MAPVOTE_COUNT - 1, cvar("g_maplist_votable"));
else
@@ -1906,7 +1906,7 @@
}
}
result = strcat(result, ":didn't vote:", ftos(didntvote));
-
+
GameLogEcho(result, FALSE);
if(mapvote_maps_suggested[mappos])
GameLogEcho(strcat(":vote:suggestion_accepted:", mapvote_maps[mappos]), FALSE);
@@ -2246,6 +2246,8 @@
if(!sv_cheats)
db_save(ServerProgsDB, "server.db");
print("done!\n");
+ // tell the bot system the game is ending now
+ bot_endgame();
}
else
{
More information about the nexuiz-commits
mailing list