X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Ftriggers%2Fmisc%2Fcorner.qc;h=dcc44710fc4e2fe6f746d3c8fd85b0d8da06f7de;hb=ad968484aff56d9765a62a9428b99b6e0a508ac5;hp=35ad2ceb49e2e4d70d1dcaf8ba20d641b4bbef57;hpb=2860c33fe91a4fce1a7e66d21fed906c62a407c4;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/triggers/misc/corner.qc b/qcsrc/common/triggers/misc/corner.qc index 35ad2ceb4..dcc44710f 100644 --- a/qcsrc/common/triggers/misc/corner.qc +++ b/qcsrc/common/triggers/misc/corner.qc @@ -1,85 +1,90 @@ +#include "corner.qh" +REGISTER_NET_LINKED(ENT_CLIENT_CORNER) + #ifdef SVQC -bool corner_send(entity to, int sf) +bool corner_send(entity this, entity to, int sf) { - WriteByte(MSG_ENTITY, ENT_CLIENT_CORNER); + WriteHeader(MSG_ENTITY, ENT_CLIENT_CORNER); - WriteString(MSG_ENTITY, self.platmovetype); + WriteString(MSG_ENTITY, this.platmovetype); - WriteCoord(MSG_ENTITY, self.origin_x); - WriteCoord(MSG_ENTITY, self.origin_y); - WriteCoord(MSG_ENTITY, self.origin_z); + WriteCoord(MSG_ENTITY, this.origin_x); + WriteCoord(MSG_ENTITY, this.origin_y); + WriteCoord(MSG_ENTITY, this.origin_z); - WriteString(MSG_ENTITY, self.target); - WriteString(MSG_ENTITY, self.target2); - WriteString(MSG_ENTITY, self.target3); - WriteString(MSG_ENTITY, self.target4); - WriteString(MSG_ENTITY, self.targetname); - WriteByte(MSG_ENTITY, self.target_random); + WriteString(MSG_ENTITY, this.target); + WriteString(MSG_ENTITY, this.target2); + WriteString(MSG_ENTITY, this.target3); + WriteString(MSG_ENTITY, this.target4); + WriteString(MSG_ENTITY, this.targetname); + WriteByte(MSG_ENTITY, this.target_random); - WriteByte(MSG_ENTITY, self.wait); + WriteByte(MSG_ENTITY, this.wait); return true; } -void corner_link() +void corner_link(entity this) { - Net_LinkEntity(self, false, 0, corner_send); + //Net_LinkEntity(this, false, 0, corner_send); } -void spawnfunc_path_corner() +spawnfunc(path_corner) { // setup values for overriding train movement // if a second value does not exist, both start and end speeds are the single value specified - set_platmovetype(self, self.platmovetype); + set_platmovetype(this, this.platmovetype); - corner_link(); + corner_link(this); } #elif defined(CSQC) -void corner_remove() +void corner_remove(entity this) { - if(self.target) { strunzone(self.target); } - self.target = string_null; + if(this.target) { strunzone(this.target); } + this.target = string_null; - if(self.target2) { strunzone(self.target2); } - self.target2 = string_null; + if(this.target2) { strunzone(this.target2); } + this.target2 = string_null; - if(self.target3) { strunzone(self.target3); } - self.target3 = string_null; + if(this.target3) { strunzone(this.target3); } + this.target3 = string_null; - if(self.target4) { strunzone(self.target4); } - self.target4 = string_null; + if(this.target4) { strunzone(this.target4); } + this.target4 = string_null; - if(self.targetname) { strunzone(self.targetname); } - self.targetname = string_null; + if(this.targetname) { strunzone(this.targetname); } + this.targetname = string_null; - if(self.platmovetype) { strunzone(self.platmovetype); } - self.platmovetype = string_null; + if(this.platmovetype) { strunzone(this.platmovetype); } + this.platmovetype = string_null; } -void ent_corner() +NET_HANDLE(ENT_CLIENT_CORNER, bool isnew) { - self.platmovetype = strzone(ReadString()); + this.platmovetype = strzone(ReadString()); + + this.origin_x = ReadCoord(); + this.origin_y = ReadCoord(); + this.origin_z = ReadCoord(); + setorigin(this, this.origin); - self.origin_x = ReadCoord(); - self.origin_y = ReadCoord(); - self.origin_z = ReadCoord(); - setorigin(self, self.origin); + this.target = strzone(ReadString()); + this.target2 = strzone(ReadString()); + this.target3 = strzone(ReadString()); + this.target4 = strzone(ReadString()); + this.targetname = strzone(ReadString()); + this.target_random = ReadByte(); - self.target = strzone(ReadString()); - self.target2 = strzone(ReadString()); - self.target3 = strzone(ReadString()); - self.target4 = strzone(ReadString()); - self.targetname = strzone(ReadString()); - self.target_random = ReadByte(); + this.wait = ReadByte(); - self.wait = ReadByte(); + return = true; - self.classname = "path_corner"; - self.drawmask = MASK_NORMAL; - self.entremove = corner_remove; + this.classname = "path_corner"; + this.drawmask = MASK_NORMAL; + this.entremove = corner_remove; - set_platmovetype(self, self.platmovetype); + set_platmovetype(this, this.platmovetype); } #endif