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(!spawncode_first_load)
15 initialize_field_db();
16 spawncode_first_load = TRUE;
21 e.spawnflags = MONSTERFLAG_SPAWNED;
24 e.spawnflags |= MONSTERFLAG_NORESPAWN;
28 if not(spawnmonster_checkinlist(monster, autocvar_g_monsters_spawn_list))
31 e.realowner = spawnedby;
34 e.monster_moveflags = moveflag;
36 if (spawnedby.classname == "monster_swarm")
37 e.monster_owner = own;
38 else if(IS_PLAYER(spawnedby))
40 if(teamplay && autocvar_g_monsters_teams)
41 e.team = spawnedby.team; // colors handled in spawn code
46 e.colormap = spawnedby.colormap;
48 if(autocvar_g_monsters_owners)
49 e.monster_owner = own; // using .owner makes the monster non-solid for its master
51 e.angles = spawnedby.angles;
54 monster = strcat("$ spawnfunc_monster_", monster);
56 target_spawn_edit_entity(e, monster, world, world, world, world, world);