X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmapobjects%2Ftriggers.qc;h=29b00d5dbcc7f34932ae1154438d88688d1b6d14;hb=c05104bde1e758c4022f9755f02f177aa0476134;hp=6968a6556a0ce2a18571a647603c228148c9bb4b;hpb=bc3f297ed082b23fb33dd0d8f5dcd33bb0198507;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/mapobjects/triggers.qc b/qcsrc/common/mapobjects/triggers.qc index 6968a6556..29b00d5db 100644 --- a/qcsrc/common/mapobjects/triggers.qc +++ b/qcsrc/common/mapobjects/triggers.qc @@ -1,7 +1,4 @@ #include "triggers.qh" -#ifdef SVQC - #include -#endif void SUB_DontUseTargets(entity this, entity actor, entity trigger) { } @@ -13,17 +10,6 @@ void DelayThink(entity this) delete(this); } -void FixSize(entity e) -{ - e.mins_x = rint(e.mins_x); - e.mins_y = rint(e.mins_y); - e.mins_z = rint(e.mins_z); - - e.maxs_x = rint(e.maxs_x); - e.maxs_y = rint(e.maxs_y); - e.maxs_z = rint(e.maxs_z); -} - #ifdef SVQC void generic_setactive(entity this, int act) { @@ -57,7 +43,7 @@ void generic_netlinked_setactive(entity this, int act) void generic_netlinked_reset(entity this) { - IFTARGETED + if(this.targetname && this.targetname != "") { if(this.spawnflags & START_ENABLED) { @@ -79,7 +65,7 @@ void generic_netlinked_reset(entity this) // Compatibility with old maps void generic_netlinked_legacy_use(entity this, entity actor, entity trigger) { - LOG_WARNF("Entity %s was (de)activated by a trigger, please update map to use relays", this.targetname); + //LOG_WARNF("Entity %s was (de)activated by a trigger, please update map to use relays", this.targetname); this.setactive(this, ACTIVE_TOGGLE); } @@ -249,7 +235,7 @@ match (string)this.target and call their .use function ============================== */ -void SUB_UseTargets_Ex(entity this, entity actor, entity trigger, bool preventReuse) +void SUB_UseTargets_Ex(entity this, entity actor, entity trigger, bool preventReuse, int skiptargets) { // // check for a delay @@ -263,10 +249,10 @@ void SUB_UseTargets_Ex(entity this, entity actor, entity trigger, bool preventRe t.enemy = actor; t.message = this.message; t.killtarget = this.killtarget; - t.target = this.target; - t.target2 = this.target2; - t.target3 = this.target3; - t.target4 = this.target4; + if(!(skiptargets & BIT(1))) t.target = this.target; + if(!(skiptargets & BIT(2))) t.target2 = this.target2; + if(!(skiptargets & BIT(3))) t.target3 = this.target3; + if(!(skiptargets & BIT(4))) t.target4 = this.target4; t.antiwall_flag = this.antiwall_flag; return; } @@ -306,6 +292,8 @@ void SUB_UseTargets_Ex(entity this, entity actor, entity trigger, bool preventRe for(int i = 0; i < 4; ++i) { + if(skiptargets & BIT(i + 1)) + continue; switch(i) { default: @@ -316,12 +304,9 @@ void SUB_UseTargets_Ex(entity this, entity actor, entity trigger, bool preventRe } if (s != "") { - // Flag to set func_clientwall state - // 1 == deactivate, 2 == activate, 0 == do nothing - int aw_flag = this.antiwall_flag; for(entity t = NULL; (t = find(t, targetname, s)); ) { - if(t.use && (t.sub_target_used != time || !preventReuse)) + if(t != this && t.use && (t.sub_target_used != time || !preventReuse)) { if(this.target_random) { @@ -329,9 +314,6 @@ void SUB_UseTargets_Ex(entity this, entity actor, entity trigger, bool preventRe } else { - if (t.classname == "func_clientwall" || t.classname == "func_clientillusionary") - t.antiwall_flag = aw_flag; - t.use(t, actor, this); if(preventReuse) t.sub_target_used = time; @@ -349,5 +331,6 @@ void SUB_UseTargets_Ex(entity this, entity actor, entity trigger, bool preventRe } } -void SUB_UseTargets(entity this, entity actor, entity trigger) { SUB_UseTargets_Ex(this, actor, trigger, false); } -void SUB_UseTargets_PreventReuse(entity this, entity actor, entity trigger) { SUB_UseTargets_Ex(this, actor, trigger, true); } +void SUB_UseTargets(entity this, entity actor, entity trigger) { SUB_UseTargets_Ex(this, actor, trigger, false, 0); } +void SUB_UseTargets_PreventReuse(entity this, entity actor, entity trigger) { SUB_UseTargets_Ex(this, actor, trigger, true, 0); } +void SUB_UseTargets_SkipTargets(entity this, entity actor, entity trigger, int skiptargets) { SUB_UseTargets_Ex(this, actor, trigger, false, skiptargets); }