X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmonsters%2Fspawn.qc;h=5bfef1b8f574ab407250f1ba0433df9346488658;hb=fc62dfa34fa5b13d63660d5249633af1222d6476;hp=924a728a07678ed0101b537a35ba07a8997f8d69;hpb=b7d32c1f333da63877913b30c861230243ce1213;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/monsters/spawn.qc b/qcsrc/common/monsters/spawn.qc index 924a728a0..5bfef1b8f 100644 --- a/qcsrc/common/monsters/spawn.qc +++ b/qcsrc/common/monsters/spawn.qc @@ -1,7 +1,18 @@ -entity spawnmonster (string monster, float monster_id, entity spawnedby, entity own, vector orig, float respwn, float moveflag) +#if defined(CSQC) +#elif defined(MENUQC) +#elif defined(SVQC) + #include "../../dpdefs/progsdefs.qh" + #include "../util.qh" + #include "all.qh" + #include "sv_monsters.qh" + #include "spawn.qh" + #include "../../server/autocvars.qh" + #include "../../server/defs.qh" +#endif +entity spawnmonster (string monster, float monster_id, entity spawnedby, entity own, vector orig, float respwn, float invincible, float moveflag) { // ensure spawnfunc database is initialized - initialize_field_db(); + //initialize_field_db(); entity e = spawn(); float i; @@ -11,6 +22,9 @@ entity spawnmonster (string monster, float monster_id, entity spawnedby, entity if(!respwn) e.spawnflags |= MONSTERFLAG_NORESPAWN; + if(invincible) + e.spawnflags |= MONSTERFLAG_INVINCIBLE; + setorigin(e, orig); if(monster == "random") @@ -31,7 +45,8 @@ entity spawnmonster (string monster, float monster_id, entity spawnedby, entity mon = get_monsterinfo(i); if(mon.netname == monster) { - found = TRUE; + found = true; + monster_id = mon.monsterid; // we have the monster, old monster id is no longer required break; } } @@ -59,9 +74,14 @@ entity spawnmonster (string monster, float monster_id, entity spawnedby, entity e.angles = spawnedby.angles; } - monster = strcat("$ spawnfunc_monster_", monster); + //monster = strcat("$ spawnfunc_monster_", monster); + + entity oldself = self; + self = e; + monster_initialize(monster_id); + self = oldself; - target_spawn_edit_entity(e, monster, world, world, world, world, world); + //target_spawn_edit_entity(e, monster, world, world, world, world, world); return e; }