NetworkEvent optimization (more frequent use of WriteRangedSingle)

This commit is contained in:
Regalis11
2015-10-25 00:06:32 +03:00
parent 3335f87f64
commit aeeae13b35
15 changed files with 84 additions and 56 deletions

View File

@@ -653,7 +653,7 @@ namespace Barotrauma
message.Write((float)NetTime.Now);
message.Write(byteIndex);
message.Write(sections[sectionIndex].damage);
message.WriteRangedSingle(sections[sectionIndex].damage/Health, 0.0f, 1.0f, 8);
return true;
}
@@ -668,7 +668,7 @@ namespace Barotrauma
{
updateTime = message.ReadFloat();
sectionIndex = message.ReadByte();
damage = message.ReadFloat();
damage = message.ReadRangedSingle(0.0f, 1.0f, 8) * Health;
}
catch
{