mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 06:42:08 +00:00
Fix for Morph virtual
Allows class<MorphedMonster> to be used as an argument type in place of class<Actor> within the third argument for backwards compatibility.
This commit is contained in:
parent
05167fd4ef
commit
0ef042562e
3 changed files with 17 additions and 1 deletions
|
@ -669,6 +669,8 @@ PClass *PClass::FindClassTentative(FName name)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
bool ShouldAllowGameSpecificVirtual(FName name, unsigned index, PType* arg, PType* varg);
|
||||
|
||||
int PClass::FindVirtualIndex(FName name, PFunction::Variant *variant, PFunction *parentfunc, bool exactReturnType, bool ignorePointerReadOnly)
|
||||
{
|
||||
auto proto = variant->Proto;
|
||||
|
@ -700,7 +702,7 @@ int PClass::FindVirtualIndex(FName name, PFunction::Variant *variant, PFunction
|
|||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
else if(!ShouldAllowGameSpecificVirtual(name, a, proto->ArgumentTypes[a], vproto->ArgumentTypes[a]))
|
||||
{
|
||||
fail = true;
|
||||
break;
|
||||
|
|
|
@ -463,6 +463,7 @@ xx(WBobSpeed)
|
|||
xx(WBobFire)
|
||||
xx(PlayerClass)
|
||||
xx(MonsterClass)
|
||||
xx(Morph)
|
||||
xx(MorphedMonster)
|
||||
xx(Wi_NoAutostartMap)
|
||||
|
||||
|
|
|
@ -57,6 +57,19 @@ PFunction* FindBuiltinFunction(FName funcname);
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
bool ShouldAllowGameSpecificVirtual(FName name, unsigned index, PType* arg, PType* varg)
|
||||
{
|
||||
return (name == NAME_Morph && index == 3u && arg->isClassPointer() && varg->isClassPointer()
|
||||
&& PType::toClassPointer(varg)->ClassRestriction->TypeName == NAME_Actor
|
||||
&& PType::toClassPointer(arg)->ClassRestriction->TypeName == NAME_MorphedMonster);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
bool isActor(PContainerType *type)
|
||||
{
|
||||
auto cls = PType::toClass(type);
|
||||
|
|
Loading…
Reference in a new issue