(VScript) Server crash on attempt to fetch prop_vehicle_driveable datamaps
Server crashes once you try to use a NetProps.GetTable with second parameter being the DataMap(1) on a prop_vehicle_driveable
The following script replicates it:
local vehicle = Entities.CreateByClassname("prop_vehicle_driveable");
NetProps.GetTable(vehicle, 1, {});
Or this one works as well
local vehicle = SpawnEntityFromTable("prop_vehicle_driveable", {
vehiclescript = "scripts/vehicles/airboat.txt",
model = "models/buggy.mdl"
});
NetProps.GetTable(vehicle, 1, {});
It also affects bot_proxy
To add on to this, the crash seems to be specifically tied to the string-based datamap keyvalues.
As it crashes specifically when
g_pScriptVM->SetValue( hTable, pszPropName, (propString == NULL_STRING) ? "" : STRING(propString) );
is called in StoreDataPropValue.
From further testing, it seems that when I add the following code before that line the crash stops altogether. With the side effect of the netprops being read as "ERROR VALUE" until NetProps.GetPropString is called before NetProps.GetTable(vehicle, 1, {}); is called.
PropInfo_t propInfo = GetEntityPropInfo( pBaseEntity, pszPropName, iElement );
if ( !propInfo.m_IsPropValid )
{
g_pScriptVM->SetValue( hTable, pszPropName, "ERROR VALUE" );
break;
}