Game Development Community

T3D 1.1Beta 2 Camera packUpdate, w fix

by Thomas · in Torque 3D Professional · 09/22/2010 (9:10 am) · 3 replies

T3D 1.1 Beta 2,
have included the fix mentioned Mounted Spotlights for Multiplayers here and mounted a camera on the same object. But the camera was controllable for mysterious reasons. Hunting down the problem it showed up, that in Camera::packUpdate the retMask was not used and 0 returned, so the eventually returned bits were dropped.
changed Camera::packUpdate to
U32 retMask = Parent::packUpdate(con, mask, bstream);
... // Last line: 
   return retMask; // was 0!

Hope this helps others to build networked games!

#1
09/22/2010 (10:32 am)
Same needed for another return:
... // skipped
   // The rest of the data is part of the control object packet update.
   // If we're controlled by this client, we don't need to send it.
   if(bstream->writeFlag(getControllingClient() == con && !(mask & InitialUpdateMask)))
      return retMask; // changed, was "return 0";
... // skipped
#2
09/22/2010 (10:43 am)
Correct! Wanted to add it a second ago, you have been faster! ;-)
#3
09/23/2010 (7:25 am)
btw, same with:
Precipitation::packUpdate()
MissionArea::packUpdate()
PathCamera::packUpdate()

And, the last part (writeFlag) in PathCamera::packUpdate doesn't needed at all.