* Add format specifier "%E" (#2099) * style: Remove extra blank lines
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#include <am-float.h>
|
||||
#include <am-string.h>
|
||||
#include <IDBDriver.h>
|
||||
#include <IGameHelpers.h>
|
||||
#include <ITranslator.h>
|
||||
#include <bridge/include/IScriptManager.h>
|
||||
#include <bridge/include/CoreProvider.h>
|
||||
@@ -1226,6 +1227,22 @@ reswitch:
|
||||
arg++;
|
||||
break;
|
||||
}
|
||||
case 'E':
|
||||
{
|
||||
CHECK_ARGS(0);
|
||||
cell_t *value;
|
||||
pCtx->LocalToPhysAddr(params[arg], &value);
|
||||
|
||||
CBaseEntity *entity = gamehelpers->ReferenceToEntity(*value);
|
||||
if (!entity)
|
||||
return pCtx->ThrowNativeError("Entity index %d is invalid (arg %d)", *value, arg);
|
||||
|
||||
const char *classname = gamehelpers->GetEntityClassname(entity);
|
||||
if (!AddString(&buf_p, llen, classname, width, prec, flags))
|
||||
return pCtx->ThrowNativeError("Escaped string would be truncated (arg %d)", arg);
|
||||
arg++;
|
||||
break;
|
||||
}
|
||||
case 's':
|
||||
{
|
||||
CHECK_ARGS(0);
|
||||
|
||||
Reference in New Issue
Block a user