Remove the unknown 255 attachment which caused by Endcontroller replacement
This commit is contained in:
parent
b6caf00bfc
commit
6eaa88a3f5
@ -269,13 +269,7 @@ void Attachment::saveState(BareNetworkString *buffer) const
|
||||
void Attachment::rewindTo(BareNetworkString *buffer)
|
||||
{
|
||||
uint8_t type = buffer->getUInt8();
|
||||
|
||||
AttachmentType new_type = AttachmentType(type & 0x7f); // mask out bit 7
|
||||
// FIXME Sometimes type == 255 is returned, reason unknown
|
||||
if (new_type > ATTACH_NOTHING)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// If there is no attachment, clear the attachment if necessary and exit
|
||||
if(new_type==ATTACH_NOTHING)
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "karts/kart_properties.hpp"
|
||||
#include "karts/controller/ai_properties.hpp"
|
||||
#include "modes/world.hpp"
|
||||
#include "network/network_string.hpp"
|
||||
#include "tracks/track.hpp"
|
||||
#include "utils/constants.hpp"
|
||||
|
||||
@ -328,3 +329,18 @@ void AIBaseController::determineTurnRadius(const Vec3 &end, Vec3 *center,
|
||||
}
|
||||
|
||||
} // determineTurnRadius
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void AIBaseController::saveState(BareNetworkString *buffer) const
|
||||
{
|
||||
// Endcontroller needs this for proper offset in kart rewinder
|
||||
buffer->addUInt32(0).addUInt32(0).addUInt32(0);
|
||||
} // copyToBuffer
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
void AIBaseController::rewindTo(BareNetworkString *buffer)
|
||||
{
|
||||
// Endcontroller needs this for proper offset in kart rewinder
|
||||
// Skip 3 uint32_t
|
||||
buffer->skip(3 * 4);
|
||||
} // rewindTo
|
||||
|
@ -104,9 +104,8 @@ public:
|
||||
};
|
||||
virtual void skidBonusTriggered() {};
|
||||
// ------------------------------------------------------------------------
|
||||
/** Not used for AIs. */
|
||||
virtual void saveState(BareNetworkString *buffer) const OVERRIDE {}
|
||||
virtual void rewindTo(BareNetworkString *buffer) OVERRIDE {}
|
||||
virtual void saveState(BareNetworkString *buffer) const OVERRIDE;
|
||||
virtual void rewindTo(BareNetworkString *buffer) OVERRIDE;
|
||||
|
||||
}; // AIBaseController
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user