|
From: <bul...@us...> - 2013-05-23 06:23:57
|
Revision: 22766
http://sourceforge.net/p/bzflag/code/22766
Author: bullet_catcher
Date: 2013-05-23 06:23:54 +0000 (Thu, 23 May 2013)
Log Message:
-----------
Revert GuidedMissileStrategy::sendUpdate() to const on the object to match
the way it is called, preventing fallback to the base class's sendUpdate().
Also make "needUpdate" mutable to avoid ugly const casting.
This fixes the remote client GM tracking bug introduced in r22751.
Revision Links:
--------------
http://sourceforge.net/p/bzflag/code/22751
Modified Paths:
--------------
trunk/bzflag/src/bzflag/GuidedMissleStrategy.cxx
trunk/bzflag/src/bzflag/GuidedMissleStrategy.h
Modified: trunk/bzflag/src/bzflag/GuidedMissleStrategy.cxx
===================================================================
--- trunk/bzflag/src/bzflag/GuidedMissleStrategy.cxx 2013-05-18 22:11:53 UTC (rev 22765)
+++ trunk/bzflag/src/bzflag/GuidedMissleStrategy.cxx 2013-05-23 06:23:54 UTC (rev 22766)
@@ -377,11 +377,11 @@
return minTime;
}
-void GuidedMissileStrategy::sendUpdate(const FiringInfo& firingInfo)
+void GuidedMissileStrategy::sendUpdate(const FiringInfo& firingInfo) const
{
// only send an update when needed
if (!needUpdate) return;
- this->needUpdate = false;
+ needUpdate = false;
// construct and send packet
char packet[ShotUpdatePLen + PlayerIdPLen];
Modified: trunk/bzflag/src/bzflag/GuidedMissleStrategy.h
===================================================================
--- trunk/bzflag/src/bzflag/GuidedMissleStrategy.h 2013-05-18 22:11:53 UTC (rev 22765)
+++ trunk/bzflag/src/bzflag/GuidedMissleStrategy.h 2013-05-23 06:23:54 UTC (rev 22766)
@@ -36,7 +36,7 @@
void update(float dt);
float checkHit(const BaseLocalPlayer*, float[3]) const;
- void sendUpdate(const FiringInfo&);
+ void sendUpdate(const FiringInfo&) const;
void readUpdate(uint16_t, const void*);
void addShot(SceneDatabase*, bool colorblind);
void expire();
@@ -57,7 +57,7 @@
float puffTime,rootPuff;
TimeKeeper lastPuff;
- bool needUpdate;
+ mutable bool needUpdate;
PlayerId lastTarget;
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|