- Clean up excess code around a few calls to SingleActorFromTID(), since that function is already

designed specifically to handle the case where tid is 0.

SVN r4315 (trunk)
This commit is contained in:
Randy Heit 2013-06-01 17:13:15 +00:00
parent 037477a20b
commit e9702fc43d

View file

@ -4598,7 +4598,7 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args)
FName varname(FBehavior::StaticLookupString(args[1]), true); FName varname(FBehavior::StaticLookupString(args[1]), true);
if (varname != NAME_None) if (varname != NAME_None)
{ {
AActor *a = args[0] == 0 ? (AActor *)activator : SingleActorFromTID(args[0], NULL); AActor *a = SingleActorFromTID(args[0], activator);
return a != NULL ? GetUserVariable(a, varname, 0) : 0; return a != NULL ? GetUserVariable(a, varname, 0) : 0;
} }
return 0; return 0;
@ -4637,7 +4637,7 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args)
FName varname(FBehavior::StaticLookupString(args[1]), true); FName varname(FBehavior::StaticLookupString(args[1]), true);
if (varname != NAME_None) if (varname != NAME_None)
{ {
AActor *a = args[0] == 0 ? (AActor *)activator : SingleActorFromTID(args[0], NULL); AActor *a = SingleActorFromTID(args[0], activator);
return a != NULL ? GetUserVariable(a, varname, args[2]) : 0; return a != NULL ? GetUserVariable(a, varname, args[2]) : 0;
} }
return 0; return 0;
@ -4649,7 +4649,7 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args)
case ACSF_CheckActorClass: case ACSF_CheckActorClass:
{ {
AActor *a = args[0] == 0 ? (AActor *)activator : SingleActorFromTID(args[0], NULL); AActor *a = SingleActorFromTID(args[0], activator);
return a == NULL ? false : a->GetClass()->TypeName == FName(FBehavior::StaticLookupString(args[1])); return a == NULL ? false : a->GetClass()->TypeName == FName(FBehavior::StaticLookupString(args[1]));
} }