Expected result: The client receives the int and float values and plays the faint or irritated-eyes effect.
Actual result: The client receives empty data, no effect plays, and a script error is logged.
Suggested fix: Write the array lengths and values, then read them back:
override bool Serialize(Serializer ctx)
{
if (!ctx.Write(m_IntArray.Count())) return false;
foreach (int i : m_IntArray) if (!ctx.Write(i)) return false;
if (!ctx.Write(m_FloatArray.Count())) return false;
foreach (float f : m_FloatArray) if (!ctx.Write(f)) return false;
return true;
}
override bool Deserializer(Serializer ctx)
{
int n; float fv; int iv;
if (!ctx.Read(n)) return false;
m_IntArray.Clear();
for (int a = 0; a < n; a++) { if (!ctx.Read(iv)) return false; m_IntArray.Insert(iv); }
if (!ctx.Read(n)) return false;
m_FloatArray.Clear();
for (int b = 0; b < n; b++) { if (!ctx.Read(fv)) return false; m_FloatArray.Insert(fv); }
return true;
}
Also guard FaintState.SetParam and IrritatedEyes.SetParam with if (faintData && faintData.m_IntArray.Count() > 0).
Possibly related: DZG-1425, "Nasdara - heatstroke issues, and killed in sandstorm(?)".