polserver/pol-core/bscript/StoredToken.cpp

23 lines
609 B
C++
Raw Permalink Normal View History

#include "bscript/StoredToken.h"
2020-05-29 21:06:36 -07:00
#include "clib/logfacility.h"
2020-05-29 21:06:36 -07:00
namespace Pol::Bscript
2020-05-29 21:06:36 -07:00
{
StoredToken::StoredToken( unsigned char aModule, int aID, BTokenType aType, unsigned aOffset )
: type( static_cast<unsigned char>( aType ) ),
id( static_cast<unsigned char>( aID ) ),
offset( static_cast<unsigned short>( aOffset ) ),
module( aModule )
{
if ( offset != aOffset )
{
ERROR_PRINTLN(
"Data segment overflowed.\nFlog the programmer for using 2-byte offsets in datafiles." );
2020-05-29 21:06:36 -07:00
throw std::runtime_error( "Data segment overflowed" );
}
}
} // namespace Pol::Bscript