void plat_delayedinit(entity this)
{
plat_link(this);
- plat_spawn_inside_trigger(this); // the "start moving" trigger
+ // Q3 uses only a truth check of .targetname to decide whether to spawn a trigger
+ if(!Q3COMPAT_COMMON || this.targetname == "")
+ plat_spawn_inside_trigger(this); // the "start moving" trigger
}
float plat_send(entity this, entity to, float sf)
set_movetype(this, MOVETYPE_PUSH);
this.move_time = time;
- plat_spawn_inside_trigger(this);
+ if(!Q3COMPAT_COMMON || this.targetname == "")
+ plat_spawn_inside_trigger(this);
}
if(sf & SF_TRIGGER_RESET)
plat_go_down(this);
}
+void plat_target_use(entity this, entity actor, entity trigger)
+{
+ if (this.state == STATE_TOP)
+ this.nextthink = this.ltime + 1;
+ else if (this.state != STATE_UP)
+ plat_go_up(this);
+}
+
// WARNING: backwards compatibility because people don't use already existing fields :(
// TODO: Check if any maps use these fields and remove these fields if it doesn't break maps
.string sound1, sound2;
{
setorigin(this, this.pos2);
this.state = STATE_BOTTOM;
- this.use = plat_trigger_use;
+ this.use = (this.targetname != "" && Q3COMPAT_COMMON) ? plat_target_use : plat_trigger_use;
}
#ifdef SVQC