else
this.team = NUM_TEAM_1;
- spawnfunc_func_breakable(this);
+ func_breakable_setup(this);
}
spawnfunc(func_assault_wall)
func_breakable_behave_restore(this);
}
-// destructible walls that can be used to trigger target_objective_decrease
-spawnfunc(func_breakable)
+void func_breakable_setup(entity this)
{
float n, i;
if(!GetResource(this, RES_HEALTH))
}
// for use in maps with a "model" key set
-spawnfunc(misc_breakablemodel) {
- spawnfunc_func_breakable(this);
-}
+spawnfunc(misc_breakablemodel) { func_breakable_setup(this); }
+
+// destructible walls that can be used to trigger target_objective_decrease
+spawnfunc(func_breakable) { func_breakable_setup(this); }
#endif
const int STATE_BROKEN = 1;
#ifdef SVQC
-spawnfunc(func_breakable);
+void func_breakable_setup(entity this);
#endif
}
else
{
- entity e = spawn();
+ entity e = new(func_breakable);
e.model = strzone(argv(1));
e.mdl = "rocket_explode";
SetResourceExplicit(e, RES_HEALTH, 1000);
e.angles = fixedvectoangles2(trace_plane_normal, v_forward);
e.angles = AnglesTransform_ApplyToAngles(e.angles, '-90 0 0'); // so unrotated models work
}
- spawnfunc_func_breakable(e);
+ func_breakable_setup(e);
// now, is it valid?
if(f == 0)
{