diff --git a/src/g_inventory/a_weapons.cpp b/src/g_inventory/a_weapons.cpp index 9d7f184d0..e4079121a 100644 --- a/src/g_inventory/a_weapons.cpp +++ b/src/g_inventory/a_weapons.cpp @@ -514,7 +514,7 @@ FState *AWeapon::GetStateForButtonName (FName button) bool FWeaponSlot::AddWeapon(const char *type) { - return AddWeapon(static_cast(PClass::FindClass(type))); + return AddWeapon(PClass::FindActor(type)); } bool FWeaponSlot::AddWeapon(PClassActor *type) @@ -1443,7 +1443,7 @@ void P_SetupWeapons_ntohton() if (cls->IsDescendantOf(NAME_Weapon)) { - Weapons_ntoh.Push(static_cast(cls)); + Weapons_ntoh.Push(cls); } } qsort(&Weapons_ntoh[1], Weapons_ntoh.Size() - 1, sizeof(Weapons_ntoh[0]), ntoh_cmp); diff --git a/src/g_shared/shared_hud.cpp b/src/g_shared/shared_hud.cpp index 19183a437..c414a9275 100644 --- a/src/g_shared/shared_hud.cpp +++ b/src/g_shared/shared_hud.cpp @@ -385,21 +385,20 @@ static void SetKeyTypes() { for(unsigned int i = 0; i < PClassActor::AllActorClasses.Size(); i++) { - PClass *ti = PClassActor::AllActorClasses[i]; + PClassActor *ti = PClassActor::AllActorClasses[i]; auto kt = PClass::FindActor(NAME_Key); if (ti->IsDescendantOf(kt)) { - PClassActor *tia = static_cast(ti); - AInventory *key = (AInventory*)(GetDefaultByType(tia)); + AInventory *key = (AInventory*)(GetDefaultByType(ti)); if (key->Icon.isValid() && key->special1 > 0) { - KeyTypes.Push(tia); + KeyTypes.Push(ti); } else { - UnassignedKeyTypes.Push(tia); + UnassignedKeyTypes.Push(ti); } } } diff --git a/src/info.cpp b/src/info.cpp index 6f00609af..71216cc06 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -282,7 +282,7 @@ void PClassActor::StaticSetActorNums() { for (unsigned int i = 0; i < PClassActor::AllActorClasses.Size(); ++i) { - static_cast(PClassActor::AllActorClasses[i])->RegisterIDs(); + PClassActor::AllActorClasses[i]->RegisterIDs(); } } diff --git a/src/scripting/decorate/thingdef_parse.cpp b/src/scripting/decorate/thingdef_parse.cpp index adda5b0e9..7b31336fd 100644 --- a/src/scripting/decorate/thingdef_parse.cpp +++ b/src/scripting/decorate/thingdef_parse.cpp @@ -1116,7 +1116,7 @@ static PClassActor *ParseActorHeader(FScanner &sc, Baggage *bag) sc.ScriptMessage("Replaced type '%s' not found for %s", replaceName.GetChars(), info->TypeName.GetChars()); } - ResetBaggage (bag, info == RUNTIME_CLASS(AActor) ? NULL : static_cast(info->ParentClass)); + ResetBaggage (bag, ValidateActor(info->ParentClass)); bag->Info = info; bag->Lumpnum = sc.LumpNum; #ifdef _DEBUG diff --git a/src/scripting/thingdef_properties.cpp b/src/scripting/thingdef_properties.cpp index fcfcb9b6b..b2a922b46 100644 --- a/src/scripting/thingdef_properties.cpp +++ b/src/scripting/thingdef_properties.cpp @@ -1071,7 +1071,7 @@ DEFINE_PROPERTY(distancecheck, S, Actor) } else if (cv->GetRealType() == CVAR_Int) { - static_cast(info)->ActorInfo()->distancecheck = static_cast(cv); + info->ActorInfo()->distancecheck = static_cast(cv); } else {