g_weaponswitchdelay = ReadByte() / 255.0;
+ g_balance_grenadelauncher_secondary_bouncefactor = ReadCoord();
+ g_balance_grenadelauncher_secondary_bouncestop = ReadCoord();
+
if(!postinit)
PostInit();
}
}
}
-.float bouncefactor;
-.float bouncestop;
void Ent_Projectile()
{
- float f, s;
+ float f;
// projectile properties:
// kind (interpolated, or clientside)
self.velocity_y = ReadCoord();
self.velocity_z = ReadCoord();
self.gravity = ReadCoord();
-
- s = ReadByte();
-
- if (s & 1)
- {
- self.bouncefactor = ReadCoord();
- self.bouncestop = ReadCoord();
- }
-
self.move_origin = self.origin;
self.move_velocity = self.velocity;
- self.move_bounce_factor = self.bouncefactor;
- self.move_bounce_stopspeed = self.bouncestop;
}
if(time == self.spawntime || (self.count & 0x80) || (f & 0x10))
self.maxs = '0 0 -3';
self.move_movetype = MOVETYPE_BOUNCE;
self.move_touch = SUB_Null;
+ self.move_bounce_factor = g_balance_grenadelauncher_secondary_bouncefactor;
+ self.move_bounce_stopspeed = g_balance_grenadelauncher_secondary_bouncestop;
break;
case PROJECTILE_PORTO_RED:
self.colormod = '2 1 1';
WriteString(MSG_ENTITY, world.fog);
else
WriteString(MSG_ENTITY, "");
- WriteByte(MSG_ENTITY, cvar("g_balance_armor_blockpercent") * 255.0);
- WriteByte(MSG_ENTITY, cvar("g_balance_weaponswitchdelay") * 255.0);
+ WriteByte(MSG_ENTITY, self.count * 255.0); // g_balance_armor_blockpercent
+ WriteByte(MSG_ENTITY, self.cnt * 255.0); // g_balance_weaponswitchdelay
+ WriteCoord(MSG_ENTITY, self.bouncefactor); // g_balance_grenadelauncher_secondary_bouncefactor
+ WriteCoord(MSG_ENTITY, self.bouncestop); // g_balance_grenadelauncher_secondary_bouncestop
return TRUE;
}
+void ClientInit_CheckUpdate()
+{
+ self.nextthink = time;
+ if(self.count != cvar("g_balance_armor_blockpercent"))
+ {
+ self.count = cvar("g_balance_armor_blockpercent");
+ self.SendFlags |= 1;
+ }
+ if(self.cnt != cvar("g_balance_weaponswitchdelay"))
+ {
+ self.cnt = cvar("g_balance_weaponswitchdelay");
+ self.SendFlags |= 1;
+ }
+ if(self.bouncefactor != cvar("g_balance_grenadelauncher_secondary_bouncefactor"))
+ {
+ self.bouncefactor = cvar("g_balance_grenadelauncher_secondary_bouncefactor");
+ self.SendFlags |= 1;
+ }
+ if(self.bouncestop != cvar("g_balance_grenadelauncher_secondary_bouncestop"))
+ {
+ self.bouncestop = cvar("g_balance_grenadelauncher_secondary_bouncestop");
+ self.SendFlags |= 1;
+ }
+}
+
void ClientInit_Spawn()
{
- Net_LinkEntity(spawn(), FALSE, 0, ClientInit_SendEntity);
+ entity o;
+ entity e;
+ e.classname = "clientinit";
+ e.think = ClientInit_CheckUpdate;
+ e.nextthink = time;
+ Net_LinkEntity(e, FALSE, 0, ClientInit_SendEntity);
+ o = self;
+ self = e;
+ ClientInit_CheckUpdate();
+ self = o;
}
/*
float CSQCProjectile_SendEntity(entity to, float sf)
{
float ft, fr;
- float s;
// note: flag 0x10 = no trail please
sf = sf & 0x1F;
sf |= 0x20;
}
- // HACK: subflags for sendflags = 0x80
-
- s = 0;
-
- if (self.movetype == MOVETYPE_BOUNCEMISSILE || self.movetype == MOVETYPE_BOUNCE)
- s |= 1;
-
WriteByte(MSG_ENTITY, ENT_CLIENT_PROJECTILE);
WriteByte(MSG_ENTITY, sf);
WriteCoord(MSG_ENTITY, self.velocity_y);
WriteCoord(MSG_ENTITY, self.velocity_z);
WriteCoord(MSG_ENTITY, self.gravity);
-
- WriteByte(MSG_ENTITY, s);
-
- if (s & 1)
- {
- WriteCoord(MSG_ENTITY, self.bouncefactor);
- WriteCoord(MSG_ENTITY, self.bouncestop);
- }
}
if(sf & 0x20)