1 float spawnmonster_checkinlist(string monster, string list)
3 string l = strcat(" ", list, " ");
5 if(strstrofs(l, strcat(" ", monster, " "), 0) >= 0)
11 entity spawnmonster (string monster, entity spawnedby, entity own, vector orig, float respwn, float moveflag)
13 if not(autocvar_g_monsters)
15 if(spawnedby.flags & FL_CLIENT)
16 Send_Notification(NOTIF_ONE, spawnedby, MSG_INFO, INFO_MONSTERS_DISABLED);
21 if(spawnedby.vehicle) // no vehicle player spawning...
24 if(!spawncode_first_load)
26 initialize_field_db();
27 spawncode_first_load = TRUE;
32 e.spawnflags = MONSTERFLAG_SPAWNED;
35 e.spawnflags |= MONSTERFLAG_NORESPAWN;
39 if not(spawnmonster_checkinlist(monster, autocvar_g_monsters_spawn_list))
42 e.realowner = spawnedby;
45 e.monster_moveflags = moveflag;
47 if (spawnedby.classname == "monster_swarm")
48 e.monster_owner = own;
49 else if(spawnedby.flags & FL_CLIENT)
51 if(teamplay && autocvar_g_monsters_teams)
52 e.team = spawnedby.team; // colors handled in spawn code
55 e.colormap = spawnedby.colormap;
57 if(autocvar_g_monsters_owners)
58 e.monster_owner = own; // using owner makes the monster non-solid for its master
60 e.angles = spawnedby.angles;
63 if(autocvar_g_monsters_giants_only)
64 e.spawnflags |= MONSTERFLAG_GIANT;
66 monster = strcat("$ spawnfunc_monster_", monster);
68 target_spawn_edit_entity(e, monster, world, world, world, world, world);