From 8256f25a84618fd0598ba53602b5e6de3ba7cc8d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 18 Jan 2017 23:46:19 +0100 Subject: [PATCH] - no need to keep AArmor native, now that all child classes have been scriptified. --- src/ct_chat.cpp | 1 - src/d_dehacked.cpp | 1 - src/g_inventory/a_armor.cpp | 57 ----------------------- src/g_inventory/a_armor.h | 10 ---- src/g_shared/a_morph.cpp | 3 +- src/g_shared/sbarinfo.cpp | 1 - src/g_shared/shared_hud.cpp | 1 - src/g_strife/strife_sbar.cpp | 1 - src/m_cheat.cpp | 1 - src/p_acs.cpp | 1 - src/p_actionfunctions.cpp | 1 - src/p_mobj.cpp | 3 +- src/p_user.cpp | 3 +- src/scripting/thingdef_properties.cpp | 1 - wadsrc/static/zscript/inventory/armor.txt | 2 +- 15 files changed, 4 insertions(+), 83 deletions(-) delete mode 100644 src/g_inventory/a_armor.cpp delete mode 100644 src/g_inventory/a_armor.h diff --git a/src/ct_chat.cpp b/src/ct_chat.cpp index 340378434..971c94a38 100644 --- a/src/ct_chat.cpp +++ b/src/ct_chat.cpp @@ -31,7 +31,6 @@ #include "templates.h" #include "d_net.h" #include "d_event.h" -#include "a_armor.h" #define QUEUESIZE 128 #define MESSAGESIZE 128 diff --git a/src/d_dehacked.cpp b/src/d_dehacked.cpp index f0054b290..85d10de02 100644 --- a/src/d_dehacked.cpp +++ b/src/d_dehacked.cpp @@ -74,7 +74,6 @@ #include "info.h" #include "v_text.h" #include "vmbuilder.h" -#include "a_armor.h" // [SO] Just the way Randy said to do it :) // [RH] Made this CVAR_SERVERINFO diff --git a/src/g_inventory/a_armor.cpp b/src/g_inventory/a_armor.cpp deleted file mode 100644 index eb90ba000..000000000 --- a/src/g_inventory/a_armor.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/* -** a_armor.cpp -** Implements all variations of armor objects -** -**--------------------------------------------------------------------------- -** Copyright 2002-2016 Randy Heit -** Copyright 2006-2016 Cheistoph Oelckers -** All rights reserved. -** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. -** 3. The name of the author may not be used to endorse or promote products -** derived from this software without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR -** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES -** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. -** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, -** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT -** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF -** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -**--------------------------------------------------------------------------- -** -*/ - -#include - -#include "info.h" -#include "gi.h" -#include "a_pickups.h" -#include "a_armor.h" -#include "templates.h" -#include "g_level.h" -#include "d_player.h" -#include "serializer.h" -#include "cmdlib.h" - -IMPLEMENT_CLASS(AArmor, false, false) - -//=========================================================================== -// -// -// HexenArmor -// -// -//=========================================================================== - diff --git a/src/g_inventory/a_armor.h b/src/g_inventory/a_armor.h deleted file mode 100644 index 7ed8f27ee..000000000 --- a/src/g_inventory/a_armor.h +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once - -#include "a_pickups.h" - -// Armor absorbs some damage for the player. -class AArmor : public AInventory -{ - DECLARE_CLASS (AArmor, AInventory) -}; - diff --git a/src/g_shared/a_morph.cpp b/src/g_shared/a_morph.cpp index e58165f35..68309d8cc 100644 --- a/src/g_shared/a_morph.cpp +++ b/src/g_shared/a_morph.cpp @@ -13,7 +13,6 @@ #include "serializer.h" #include "p_enemy.h" #include "d_player.h" -#include "a_armor.h" #include "r_data/sprites.h" #include "g_levellocals.h" #include "virtual.h" @@ -137,7 +136,7 @@ bool P_MorphPlayer (player_t *activator, player_t *p, PClassPlayerPawn *spawntyp for (item = morphed->Inventory; item != nullptr; ) { AInventory *next = item->Inventory; - if (item->IsKindOf (RUNTIME_CLASS(AArmor))) + if (item->IsKindOf (PClass::FindActor(NAME_Armor))) { item->DepleteOrDestroy(); } diff --git a/src/g_shared/sbarinfo.cpp b/src/g_shared/sbarinfo.cpp index f896faefe..05494522e 100644 --- a/src/g_shared/sbarinfo.cpp +++ b/src/g_shared/sbarinfo.cpp @@ -45,7 +45,6 @@ #include "st_stuff.h" #include "m_swap.h" #include "a_keys.h" -#include "a_armor.h" #include "templates.h" #include "i_system.h" #include "sbarinfo.h" diff --git a/src/g_shared/shared_hud.cpp b/src/g_shared/shared_hud.cpp index 34590aa6e..37312748c 100644 --- a/src/g_shared/shared_hud.cpp +++ b/src/g_shared/shared_hud.cpp @@ -43,7 +43,6 @@ #include "c_cvars.h" #include "w_wad.h" #include "a_keys.h" -#include "a_armor.h" #include "sbar.h" #include "sc_man.h" #include "templates.h" diff --git a/src/g_strife/strife_sbar.cpp b/src/g_strife/strife_sbar.cpp index 7fc64531f..af06b7474 100644 --- a/src/g_strife/strife_sbar.cpp +++ b/src/g_strife/strife_sbar.cpp @@ -12,7 +12,6 @@ #include "m_swap.h" #include "templates.h" #include "a_keys.h" -#include "a_armor.h" #include "gi.h" #include "g_level.h" #include "colormatcher.h" diff --git a/src/m_cheat.cpp b/src/m_cheat.cpp index 5510ec077..2f99ea61c 100644 --- a/src/m_cheat.cpp +++ b/src/m_cheat.cpp @@ -47,7 +47,6 @@ #include "serializer.h" #include "r_utility.h" #include "a_morph.h" -#include "a_armor.h" #include "g_levellocals.h" #include "virtual.h" diff --git a/src/p_acs.cpp b/src/p_acs.cpp index 09344cc76..50f50ff31 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -83,7 +83,6 @@ #include "serializer.h" #include "thingdef.h" #include "a_pickups.h" -#include "a_armor.h" #include "r_data/colormaps.h" #include "g_levellocals.h" #include "stats.h" diff --git a/src/p_actionfunctions.cpp b/src/p_actionfunctions.cpp index 929a5dafd..3c4978e0d 100644 --- a/src/p_actionfunctions.cpp +++ b/src/p_actionfunctions.cpp @@ -78,7 +78,6 @@ #include "v_text.h" #include "thingdef.h" #include "math/cmath.h" -#include "a_armor.h" #include "g_levellocals.h" AActor *SingleActorFromTID(int tid, AActor *defactor); diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 5c9440deb..1ca9baac8 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -69,7 +69,6 @@ #include "thingdef.h" #include "d_player.h" #include "virtual.h" -#include "a_armor.h" #include "g_levellocals.h" #include "a_morph.h" @@ -5698,7 +5697,7 @@ AActor *P_SpawnMapThing (FMapThing *mthing, int position) } if (dmflags & DF_NO_ARMOR) { - if (i->IsDescendantOf (RUNTIME_CLASS(AArmor))) + if (i->IsDescendantOf (PClass::FindActor(NAME_Armor))) return NULL; if (i->TypeName == NAME_Megasphere) return NULL; diff --git a/src/p_user.cpp b/src/p_user.cpp index 9e72c502e..8f2840c3d 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -59,7 +59,6 @@ #include "a_morph.h" #include "p_spec.h" #include "virtual.h" -#include "a_armor.h" #include "g_levellocals.h" static FRandom pr_skullpop ("SkullPop"); @@ -1142,7 +1141,7 @@ void APlayerPawn::FilterCoopRespawnInventory (APlayerPawn *oldplayer) item->Destroy(); } else if ((dmflags & DF_COOP_LOSE_ARMOR) && - item->IsKindOf(RUNTIME_CLASS(AArmor))) + item->IsKindOf(PClass::FindActor(NAME_Armor))) { if (defitem == NULL) { diff --git a/src/scripting/thingdef_properties.cpp b/src/scripting/thingdef_properties.cpp index 9d2423154..6cb482ed8 100644 --- a/src/scripting/thingdef_properties.cpp +++ b/src/scripting/thingdef_properties.cpp @@ -46,7 +46,6 @@ #include "templates.h" #include "r_defs.h" #include "a_pickups.h" -#include "a_armor.h" #include "s_sound.h" #include "cmdlib.h" #include "p_lnspec.h" diff --git a/wadsrc/static/zscript/inventory/armor.txt b/wadsrc/static/zscript/inventory/armor.txt index 477363edf..50161e8af 100644 --- a/wadsrc/static/zscript/inventory/armor.txt +++ b/wadsrc/static/zscript/inventory/armor.txt @@ -33,7 +33,7 @@ ** */ -class Armor : Inventory native +class Armor : Inventory { Default {