fixed bug for amb266

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40762
This commit is contained in:
Borja Ferrer 2007-05-08 22:26:30 +00:00
parent 3851dc9243
commit 9d9369079a

View File

@ -589,7 +589,8 @@ static cell_t GetWeaponName(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("IPlayerInfo not supported by game");
}
pContext->StringToLocalUTF8(params[2], static_cast<size_t>(params[3]), pInfo->GetWeaponName(), NULL);
const char *weapon = pInfo->GetWeaponName();
pContext->StringToLocalUTF8(params[2], static_cast<size_t>(params[3]), weapon ? weapon : "", NULL);
return 1;
}
@ -612,7 +613,8 @@ static cell_t GetModelName(IPluginContext *pContext, const cell_t *params)
return pContext->ThrowNativeError("IPlayerInfo not supported by game");
}
pContext->StringToLocalUTF8(params[2], static_cast<size_t>(params[3]), pInfo->GetModelName(), NULL);
const char *model = pInfo->GetModelName();
pContext->StringToLocalUTF8(params[2], static_cast<size_t>(params[3]), model ? model : "", NULL);
return 1;
}