From 7f63d7899bec4ebfe04efae7b991524bcebcb107 Mon Sep 17 00:00:00 2001 From: Brent Da Mage Date: Sat, 4 May 2024 22:20:07 -0500 Subject: [PATCH] Fixed minor bugs that gave compile errors :( --- GameMods.hpp | 2 +- source/world/entity/Cow.hpp | 2 +- source/world/entity/MobFactory.cpp | 4 ++-- source/world/entity/MobFactory.hpp | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/GameMods.hpp b/GameMods.hpp index 47129fac..a2989e27 100644 --- a/GameMods.hpp +++ b/GameMods.hpp @@ -15,7 +15,7 @@ //#define MOD_POPOUT_CONSOLE // Open a separate console aside from the game window. By default only the debugger can see our logs. Win32 Debug only. // Tests -#define TEST_SURVIVAL_MODE // Test survival mode. +//#define TEST_SURVIVAL_MODE // Test survival mode. // Features (major changes) diff --git a/source/world/entity/Cow.hpp b/source/world/entity/Cow.hpp index 502e38ac..e2240ea9 100644 --- a/source/world/entity/Cow.hpp +++ b/source/world/entity/Cow.hpp @@ -22,5 +22,5 @@ class Cow : public Animal int getMaxHealth() const override { return 10; } float getSoundVolume() const override { return 0.4; } - Entity* getBreedOffspring(Animal* pOther) { new Cow(m_pLevel); } + Entity* getBreedOffspring(Animal* pOther) { return new Cow(m_pLevel); } }; diff --git a/source/world/entity/MobFactory.cpp b/source/world/entity/MobFactory.cpp index a4ce57a2..5ea78ae2 100644 --- a/source/world/entity/MobFactory.cpp +++ b/source/world/entity/MobFactory.cpp @@ -34,9 +34,9 @@ Mob* MobFactory::CreateMob(EntityType entityType, Level *level) #undef ENT -#define ENT(enumType, classType) case ENTITY_TYPE_ ## enumType: return "entity."###classType; +#define ENT(enumType, classType) case ENTITY_TYPE_ ## enumType: return "entity."#classType; -char* MobFactory::GetMobNameID(EntityType entityType) +std::string MobFactory::GetMobNameID(EntityType entityType) { switch (entityType) { diff --git a/source/world/entity/MobFactory.hpp b/source/world/entity/MobFactory.hpp index db744146..9e91c1eb 100644 --- a/source/world/entity/MobFactory.hpp +++ b/source/world/entity/MobFactory.hpp @@ -6,6 +6,6 @@ class MobFactory { static Mob* CreateMob(EntityType entityType, Level *level); - static char* GetMobNameID(EntityType entityType); - static EntityType MobFactory::GetEntityTypeFromMobName(std::string mobName); + static std::string GetMobNameID(EntityType entityType); + static EntityType GetEntityTypeFromMobName(std::string mobName); }; \ No newline at end of file