- do not try to load empty BEHAVIOR lumps.

These would otherwise print an error message but there's a lot of maps out there which only have an empty entry to mark the map as Hexen format.
This commit is contained in:
Christoph Oelckers 2016-06-12 11:43:40 +02:00
parent 373c59f924
commit b8e392eaa5

View file

@ -3329,14 +3329,17 @@ void P_LoadReject (MapData * map, bool junk)
//
// [RH] P_LoadBehavior
//
void P_LoadBehavior (MapData * map)
void P_LoadBehavior(MapData * map)
{
map->Seek(ML_BEHAVIOR);
FBehavior::StaticLoadModule (-1, map->file, map->Size(ML_BEHAVIOR));
if (!FBehavior::StaticCheckAllGood ())
if (map->Size(ML_BEHAVIOR) > 0)
{
Printf ("ACS scripts unloaded.\n");
FBehavior::StaticUnloadModules ();
map->Seek(ML_BEHAVIOR);
FBehavior::StaticLoadModule(-1, map->file, map->Size(ML_BEHAVIOR));
}
if (!FBehavior::StaticCheckAllGood())
{
Printf("ACS scripts unloaded.\n");
FBehavior::StaticUnloadModules();
}
}