polserver/pol-core/bscript/StoredToken.cpp
turleypol 0e675c516a
use new formatter for ERROR_PRINT, added ERROR_PRINTLN (#595)
* use new formatter for ERROR_PRINT, added ERROR_PRINTLN

* remove old log define

* fix comments
2024-01-12 06:51:44 +01:00

24 lines
629 B
C++

#include "StoredToken.h"
#include "../clib/logfacility.h"
namespace Pol
{
namespace Bscript
{
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." );
throw std::runtime_error( "Data segment overflowed" );
}
}
} // namespace Bscript
} // namespace Pol