X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Ftriggers%2Ftrigger%2Fviewloc.qc;h=65deb3963d804c6ce7b9e71e2cc7a4cdc659958b;hb=2e4b6fcb1aec544934a31bd49bba5eeecaffbf86;hp=b36b5eadb2f8f39c27f0f3aa33e9d1f93816d33b;hpb=2aed36e128f8f00da9c76f9e66baae89d5bb26b2;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/triggers/trigger/viewloc.qc b/qcsrc/common/triggers/trigger/viewloc.qc index b36b5eadb..65deb3963 100644 --- a/qcsrc/common/triggers/trigger/viewloc.qc +++ b/qcsrc/common/triggers/trigger/viewloc.qc @@ -9,7 +9,7 @@ #ifdef SVQC void viewloc_think() -{ +{SELFPARAM(); entity e; // we abuse this method, rather than using normal .touch, because touch isn't reliable with multiple clients inside the same trigger, and can't "untouch" entities @@ -38,7 +38,7 @@ void viewloc_think() self.nextthink = time; } -bool trigger_viewloc_send(entity to, int sf) +bool trigger_viewloc_send(entity this, entity to, int sf) { // CSQC doesn't need to know our origin (yet), as we're only available for referencing WriteByte(MSG_ENTITY, ENT_CLIENT_VIEWLOC_TRIGGER); @@ -54,7 +54,7 @@ bool trigger_viewloc_send(entity to, int sf) } void viewloc_init() -{ +{SELFPARAM(); entity e; for(e = world; (e = find(e, targetname, self.target)); ) if(e.classname == "target_viewlocation_start") @@ -69,7 +69,7 @@ void viewloc_init() break; } - if(!self.enemy) { print("^1FAIL!\n"); remove(self); return; } + if(!self.enemy) { LOG_INFO("^1FAIL!\n"); remove(self); return; } if(!self.goalentity) self.goalentity = self.enemy; // make them match so CSQC knows what to do @@ -80,16 +80,16 @@ void viewloc_init() self.nextthink = time; } -void spawnfunc_trigger_viewlocation() +spawnfunc(trigger_viewlocation) { // we won't check target2 here yet, as it may not even need to exist - if(self.target == "") { print("^1FAIL!\n"); remove(self); return; } + if(self.target == "") { LOG_INFO("^1FAIL!\n"); remove(self); return; } EXACTTRIGGER_INIT; InitializeEntity(self, viewloc_init, INITPRIO_FINDTARGET); } -bool viewloc_send(entity to, int sf) +bool viewloc_send(entity this, entity to, int sf) { WriteByte(MSG_ENTITY, ENT_CLIENT_VIEWLOC); @@ -108,19 +108,19 @@ bool viewloc_send(entity to, int sf) .float angle; void viewloc_link() -{ +{SELFPARAM(); if(self.angle) self.angles_y = self.angle; Net_LinkEntity(self, false, 0, viewloc_send); } -void spawnfunc_target_viewlocation_start() +spawnfunc(target_viewlocation_start) { self.classname = "target_viewlocation_start"; self.cnt = 1; viewloc_link(); } -void spawnfunc_target_viewlocation_end() +spawnfunc(target_viewlocation_end) { self.classname = "target_viewlocation_end"; self.cnt = 2; @@ -128,18 +128,18 @@ void spawnfunc_target_viewlocation_end() } // compatibility -void spawnfunc_target_viewlocation() { spawnfunc_target_viewlocation_start(); } +spawnfunc(target_viewlocation) { spawnfunc_target_viewlocation_start(this); } #elif defined(CSQC) void trigger_viewloc_updatelink() -{ +{SELFPARAM(); self.enemy = findfloat(world, entnum, self.cnt); self.goalentity = findfloat(world, entnum, self.count); } void ent_viewloc_trigger() -{ +{SELFPARAM(); float point1 = ReadShort(); float point2 = ReadShort(); @@ -162,7 +162,7 @@ void ent_viewloc_trigger() } void ent_viewloc() -{ +{SELFPARAM(); self.cnt = ReadByte(); self.origin_x = ReadCoord();