#include "breakable.qh"
#ifdef SVQC
-#include <server/g_damage.qh>
+#include <server/damage.qh>
#include <server/bot/api.qh>
#include <common/csqcmodel_settings.qh>
#include <lib/csqcmodel/sv_model.qh>
//
void LaunchDebris (entity this, string debrisname, vector force)
{
- entity dbr = spawn();
+ entity dbr = new(debris);
vector org = this.absmin
+ '1 0 0' * random() * (this.absmax.x - this.absmin.x)
+ '0 1 0' * random() * (this.absmax.y - this.absmin.y)
if (this.noise1 && this.state == STATE_ALIVE && IS_REAL_CLIENT(player))
{
msg_entity = player;
- soundto (MSG_ONE, this, CH_TRIGGER_SINGLE, this.noise1, VOL_BASE, ATTEN_NORM);
+ soundto (MSG_ONE, this, CH_TRIGGER_SINGLE, this.noise1, VOL_BASE, ATTEN_NORM, 0);
}
}
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))
this.dmg_force = 200;
this.mdl = this.model;
- SetBrushEntityModel(this);
+ SetBrushEntityModel(this, true);
if(this.spawnflags & BREAKABLE_NODAMAGE)
this.use = func_breakable_destroy;
}
// 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