]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/func/plat.qc
Draw: purge SELFPARAM
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / func / plat.qc
index 4c4e5049d11b07f304c97ef4bb8f3300a36aa4f2..fc62341a85a3a09b65b158d09d6e4d2fce92cf40 100644 (file)
@@ -1,21 +1,23 @@
 #ifdef SVQC
+void plat_link();
+
 void plat_delayedinit()
 {
+       plat_link();
        plat_spawn_inside_trigger(); // the "start moving" trigger
 }
 
 float plat_send(entity to, float sf)
-{
+{SELFPARAM();
        WriteByte(MSG_ENTITY, ENT_CLIENT_PLAT);
        WriteByte(MSG_ENTITY, sf);
 
        if(sf & SF_TRIGGER_INIT)
        {
-               WriteShort(MSG_ENTITY, num_for_edict(self));
-
                WriteByte(MSG_ENTITY, self.platmovetype_start);
                WriteByte(MSG_ENTITY, self.platmovetype_turn);
                WriteByte(MSG_ENTITY, self.platmovetype_end);
+               WriteByte(MSG_ENTITY, self.spawnflags);
 
                WriteString(MSG_ENTITY, self.model);
 
@@ -54,10 +56,10 @@ float plat_send(entity to, float sf)
 
 void plat_link()
 {
-       Net_LinkEntity(self, 0, false, plat_send);
+       //Net_LinkEntity(self, 0, false, plat_send);
 }
 
-void spawnfunc_func_plat()
+spawnfunc(func_plat)
 {
        if (self.sounds == 0)
                self.sounds = 2;
@@ -122,30 +124,28 @@ void spawnfunc_func_plat()
        self.reset = plat_reset;
        plat_reset();
 
-       plat_link();
-
        InitializeEntity(self, plat_delayedinit, INITPRIO_FINDTARGET);
 }
 #elif defined(CSQC)
-void plat_draw()
+void plat_draw(entity this)
 {
        Movetype_Physics_NoMatchServer();
+       //Movetype_Physics_MatchServer(autocvar_cl_projectiles_sloppy);
 }
 
 void ent_plat()
-{
+{SELFPARAM();
        float sf = ReadByte();
 
        if(sf & SF_TRIGGER_INIT)
        {
-               self.sv_entnum = ReadShort();
-
                self.platmovetype_start = ReadByte();
                self.platmovetype_turn = ReadByte();
                self.platmovetype_end = ReadByte();
+               self.spawnflags = ReadByte();
 
                self.model = strzone(ReadString());
-               setmodel(self, self.model);
+               _setmodel(self, self.model);
 
                trigger_common_read(true);
 
@@ -171,6 +171,7 @@ void ent_plat()
 
                self.dmg = ReadShort();
 
+               self.classname = "plat";
                self.solid = SOLID_BSP;
                self.movetype = MOVETYPE_PUSH;
                self.drawmask = MASK_NORMAL;
@@ -180,9 +181,12 @@ void ent_plat()
 
                plat_reset(); // also called here
 
+               self.move_movetype = MOVETYPE_PUSH;
                self.move_origin = self.origin;
                self.move_angles = self.angles;
                self.move_time = time;
+
+               plat_spawn_inside_trigger();
        }
 
        if(sf & SF_TRIGGER_RESET)