entity mon = get_monsterinfo(mon_id);
- if(mon.spawnflags & MON_FLAG_MUTATORBLOCKED)
+ if(mon.spawnflags & MON_FLAG_MUTATORBLOCKED && !(self.spawnflags & MONSTERFLAG_SPAWNED))
{
dprint("Attempted to spawn a mutator-blocked monster rejected");
return FALSE;
vector decompressShotOrigin(float f);
#ifdef SVQC
-string rankings_reply, ladder_reply, lsmaps_reply, maplist_reply; // cached replies
+string rankings_reply, ladder_reply, lsmaps_reply, maplist_reply, monsterlist_reply; // cached replies
string records_reply[10];
#endif
if(tospawn == "list")
{
- float i;
- string list = "Available monsters:";
-
- for(i = MON_FIRST; i <= MON_LAST; ++i)
- list = strcat(list, " ", (get_monsterinfo(i)).netname);
-
- sprint(self, strcat(list, "\n"));
-
+ sprint(self, monsterlist_reply);
return;
}
if(autocvar_g_monsters_max <= 0 || autocvar_g_monsters_max_perplayer <= 0) { sprint(self, "Monster spawning is disabled.\n"); }
else if(!IS_PLAYER(self)) { sprint(self, "You can't spawn monsters while spectating.\n"); }
else if(g_invasion) { sprint(self, "You can't spawn monsters during an invasion!\n"); }
- else if not(autocvar_g_monsters) { Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_MONSTERS_DISABLED); }
+ else if(!autocvar_g_monsters) { Send_Notification(NOTIF_ONE, self, MSG_INFO, INFO_MONSTERS_DISABLED); }
else if(self.vehicle) { sprint(self, "You can't spawn monsters while driving a vehicle.\n"); }
else if(autocvar_g_campaign) { sprint(self, "You can't spawn monsters in campaign mode.\n"); }
else if(self.deadflag != DEAD_NO) { sprint(self, "You can't spawn monsters while dead.\n"); }
MapInfo_ClearTemps();
return sprintf("^7Maps available%s: %s\n", (newmaps ? " (New maps have asterisks marked in blue)" : ""), lsmaps);
}
+
+string getmonsterlist()
+{
+ string monsterlist = "", col;
+ float i;
+
+ for(i = MON_FIRST; i <= MON_LAST; ++i)
+ {
+ if(mod(i, 2)) { col = "^2"; }
+ else { col = "^3"; }
+ monsterlist = sprintf("%s%s%s ", monsterlist, col, (get_monsterinfo(i)).netname);
+ }
+
+ return sprintf("^7Monsters available: %s\n", monsterlist);
+}
string getladder(void);
string getmaplist(void);
string getlsmaps(void);
+string getmonsterlist(void);
// set up information replies for clients and server to use
maplist_reply = strzone(getmaplist());
lsmaps_reply = strzone(getlsmaps());
+ monsterlist_reply = strzone(getmonsterlist());
for(i = 0; i < 10; ++i)
{
s = getrecords(i);
MUTATOR_ONADD
{
+ float i;
+
if(time > 1) // game loads at time 1
error("This is a game type and it cannot be added at runtime.");
invasion_Initialize();
cvar_settemp("g_monsters", "1");
+
+ for(i = MON_FIRST; i <= MON_LAST; ++i)
+ get_monsterinfo(i).spawnflags &= ~MON_FLAG_MUTATORBLOCKED;
}
MUTATOR_ONROLLBACK_OR_REMOVE