- Allow NULL.

- Instead of reverting the teleport fog back to defaults, if there wasn't a class or if the class failed to be found, set it to NULL.
- P_SpawnTeleportFog will not spawn anything if it's NULL.
- Added "" so it can be used to mean 'don't change anything' for A_SetTeleFog.
This commit is contained in:
MajorCooke 2014-12-18 09:19:39 -06:00
commit dcab57b236
3 changed files with 16 additions and 5 deletions

View file

@ -5395,11 +5395,21 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SetTeleFog)
ACTION_PARAM_NAME(oldpos, 0);
ACTION_PARAM_NAME(newpos, 1);
const PClass *check = PClass::FindClass(oldpos);
if (check != NULL)
if (check == NULL || !stricmp(oldpos, "none") || !stricmp(oldpos, "null"))
self->TeleFogSourceType = NULL;
else if (!stricmp(oldpos, ""))
{ //Don't change it if it's just ""
}
else
self->TeleFogSourceType = check;
check = PClass::FindClass(newpos);
if (check != NULL)
if (check == NULL || !stricmp(newpos, "none") || !stricmp(newpos, "null"))
self->TeleFogDestType = NULL;
else if (!stricmp(newpos, ""))
{ //Don't change it if it's just ""
}
else
self->TeleFogDestType = check;
}