Fixed SDKTools sm_dump_datamaps crash on improperly created entities (bug 4424, r=pred)

This commit is contained in:
Nicholas Hastings 2010-05-26 08:30:13 -04:00
parent 12723167fc
commit fb4f6406c9

View File

@ -811,6 +811,11 @@ CON_COMMAND(sm_dump_datamaps, "Dumps the data map list as a text file")
typedescription_t *datamap = gamehelpers->FindInDataMap(pMap, "m_iEFlags");
if (!datamap)
{
continue;
}
int *eflags = (int *)((char *)entity->GetBaseEntity() + datamap->fieldOffset[TD_OFFSET_NORMAL]);
*eflags |= (1<<0); // EFL_KILLME
}