X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Ftriggers%2Ffunc%2Fconveyor.qc;h=583c737438ac3fae10131e2497018df65789ca38;hb=d271f27a5ac351a3a7b39636932f6d661492be1d;hp=b8c1310d8ca70dc148977d113d3eb4983d8d814d;hpb=03f978544a8b13a18cef1c7cc3dbcaba1c3aee4c;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/triggers/func/conveyor.qc b/qcsrc/common/triggers/func/conveyor.qc index b8c1310d8..583c73743 100644 --- a/qcsrc/common/triggers/func/conveyor.qc +++ b/qcsrc/common/triggers/func/conveyor.qc @@ -1,3 +1,5 @@ +REGISTER_NET_LINKED(ENT_CLIENT_CONVEYOR) + void conveyor_think() {SELFPARAM(); #ifdef CSQC @@ -63,16 +65,16 @@ void conveyor_use() self.SendFlags |= 2; } -void conveyor_reset() -{SELFPARAM(); - self.state = (self.spawnflags & 1); +void conveyor_reset(entity this) +{ + this.state = (this.spawnflags & 1); - self.SendFlags |= 2; + this.SendFlags |= 2; } bool conveyor_send(entity this, entity to, int sf) { - WriteByte(MSG_ENTITY, ENT_CLIENT_CONVEYOR); + WriteHeader(MSG_ENTITY, ENT_CLIENT_CONVEYOR); WriteByte(MSG_ENTITY, sf); if(sf & 1) @@ -108,37 +110,36 @@ bool conveyor_send(entity this, entity to, int sf) void conveyor_init() {SELFPARAM(); - if (!self.speed) - self.speed = 200; - self.movedir = self.movedir * self.speed; - self.think = conveyor_think; - self.nextthink = time; + if (!this.speed) this.speed = 200; + this.movedir *= this.speed; + this.think = conveyor_think; + this.nextthink = time; IFTARGETED { - self.use = conveyor_use; - self.reset = conveyor_reset; - conveyor_reset(); + this.use = conveyor_use; + this.reset = conveyor_reset; + this.reset(this); } else - self.state = 1; + this.state = 1; - FixSize(self); + FixSize(this); - Net_LinkEntity(self, 0, false, conveyor_send); + Net_LinkEntity(this, 0, false, conveyor_send); - self.SendFlags |= 1; + this.SendFlags |= 1; } spawnfunc(trigger_conveyor) { - SetMovedir(); + SetMovedir(self); EXACTTRIGGER_INIT; conveyor_init(); } spawnfunc(func_conveyor) { - SetMovedir(); + SetMovedir(self); InitMovingBrushTrigger(); self.movetype = MOVETYPE_NONE; conveyor_init(); @@ -146,7 +147,7 @@ spawnfunc(func_conveyor) #elif defined(CSQC) -void conveyor_draw(entity this) { WITH(entity, self, this, conveyor_think()); } +void conveyor_draw(entity this) { WITHSELF(this, conveyor_think()); } void conveyor_init() {SELFPARAM(); @@ -160,8 +161,8 @@ void conveyor_init() self.move_time = time; } -void ent_conveyor() -{SELFPARAM(); +NET_HANDLE(ENT_CLIENT_CONVEYOR, bool isnew) +{ float sf = ReadByte(); if(sf & 1) @@ -195,5 +196,7 @@ void ent_conveyor() if(sf & 2) self.state = ReadByte(); + + return true; } #endif