GhostIdBitSize fix in Item.cc
by Eric Hartman · in Torque Game Engine · 02/19/2005 (1:02 pm) · 2 replies
There is a hardcoded GhostIdBitSize in item::unpackupdate. The result is that if you have increasd the ghost bit size, items that you drop and do setcollisiontimeout on will be invisible until their next update. The fix is easy.
This code:
This code:
void Item::unpackUpdate(NetConnection *connection, BitStream *stream)
{
....
if (stream->readFlag()) {
S32 gIndex = stream->readInt(10);
setCollisionTimeout(static_cast<ShapeBase*>(connection->resolveGhost(gIndex)));
}
...
}Should be this:void Item::unpackUpdate(NetConnection *connection, BitStream *stream)
{
....
if (stream->readFlag()) {
[b]S32 gIndex = stream->readInt(NetConnection::GhostIdBitSize);[/b]
setCollisionTimeout(static_cast<ShapeBase*>(connection->resolveGhost(gIndex)));
}
...
}About the author
Associate Ben Garney