*Implement spell casting on transports (no more out of range error, etc)
*Add MO transports to ObjectAccessor storage *Add functions Position::RelocateOffset and Position::GetPositionOffsetTo to help offset manipulations - BIG thanks to azazelkon for creating formulas! *Add function to output debug info for MovementInfo and SpellCastTargets *Throw ByteBufferException on incorrect packGUID read *Add rfinish function to finish bytebuffer read. --HG-- branch : trunk
This commit is contained in:
@@ -254,6 +254,11 @@ class ByteBuffer
|
||||
return _rpos;
|
||||
}
|
||||
|
||||
void rfinish()
|
||||
{
|
||||
_rpos = wpos();
|
||||
}
|
||||
|
||||
size_t wpos() const { return _wpos; }
|
||||
|
||||
size_t wpos(size_t wpos_)
|
||||
@@ -296,10 +301,10 @@ class ByteBuffer
|
||||
_rpos += len;
|
||||
}
|
||||
|
||||
bool readPackGUID(uint64& guid)
|
||||
void readPackGUID(uint64& guid)
|
||||
{
|
||||
if(rpos() + 1 > size())
|
||||
return false;
|
||||
throw ByteBufferException(false, _rpos, 1, size());
|
||||
|
||||
guid = 0;
|
||||
|
||||
@@ -311,15 +316,13 @@ class ByteBuffer
|
||||
if(guidmark & (uint8(1) << i))
|
||||
{
|
||||
if(rpos() + 1 > size())
|
||||
return false;
|
||||
throw ByteBufferException(false, _rpos, 1, size());
|
||||
|
||||
uint8 bit;
|
||||
(*this) >> bit;
|
||||
guid |= (uint64(bit) << (i * 8));
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
const uint8 *contents() const { return &_storage[0]; }
|
||||
|
||||
Reference in New Issue
Block a user