mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-29 23:33:00 +00:00
Fixed A_Changemodel crash from invalid modeldef names
- Invalid modeldef names no longer result in a crash https://forum.zdoom.org/viewtopic.php?t=76810
This commit is contained in:
parent
6cf3dc045f
commit
169139c22c
1 changed files with 5 additions and 0 deletions
|
@ -5123,6 +5123,11 @@ DEFINE_ACTION_FUNCTION(AActor, A_ChangeModel)
|
||||||
|
|
||||||
if (self == nullptr)
|
if (self == nullptr)
|
||||||
ACTION_RETURN_BOOL(false);
|
ACTION_RETURN_BOOL(false);
|
||||||
|
else if (modeldef != NAME_None && PClass::FindClass(modeldef.GetChars()) == nullptr)
|
||||||
|
{
|
||||||
|
Printf("Attempt to pass invalid modeldef name %s in %s.", modeldef.GetChars(), self->GetCharacterName());
|
||||||
|
ACTION_RETURN_BOOL(false);
|
||||||
|
}
|
||||||
else if (modelindex < 0)
|
else if (modelindex < 0)
|
||||||
{
|
{
|
||||||
Printf("Attempt to pass invalid model index %d in %s, index must be non-negative.", modelindex, self->GetCharacterName());
|
Printf("Attempt to pass invalid model index %d in %s, index must be non-negative.", modelindex, self->GetCharacterName());
|
||||||
|
|
Loading…
Reference in a new issue