Skip to content

Commit

Permalink
Merge pull request #853 from WALLOFJUSTICE/dev-23-q3-2
Browse files Browse the repository at this point in the history
* hotfixes
  • Loading branch information
WALLOFJUSTICE authored Oct 25, 2024
2 parents 57d9e4f + 9c774d0 commit 750900f
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 47 deletions.
4 changes: 3 additions & 1 deletion src/actmonster.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2388,7 +2388,9 @@ void actMonster(Entity* my)
// however, there is a small part for clients:
if ( multiplayer == CLIENT )
{
if ( !MONSTER_INIT && my->getMonsterTypeFromSprite() != NOTHING && checkSpriteType(my->sprite) != 1 )
if ( !MONSTER_INIT && my->getMonsterTypeFromSprite() != NOTHING
&& (checkSpriteType(my->sprite) != 1 || my->skill[2] == -4) )
// if checkSpriteType == 1, skill[2] -4 means server has sent model details so no longer editor sprite (blue slime 189 conflicts editor bugbear 189 fix)
{
MONSTER_INIT = 1;

Expand Down
1 change: 1 addition & 0 deletions src/entity.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1242,6 +1242,7 @@ static const int FURNITURE_BUNKBED = 3;
static const int FURNITURE_PODIUM = 4;

int checkSpriteType(Sint32 sprite);
Monster editorSpriteTypeToMonster(Sint32 sprite);
extern char spriteEditorNameStrings[NUM_EDITOR_SPRITES][64];
extern char tileEditorNameStrings[NUM_EDITOR_TILES][44];
extern char monsterEditorNameStrings[NUMMONSTERS][16];
Expand Down
51 changes: 50 additions & 1 deletion src/entity_shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,56 @@ See LICENSE for details.


#include "entity.hpp"

Monster editorSpriteTypeToMonster(Sint32 sprite)
{
Monster monsterType = NOTHING;
switch ( sprite )
{
case 27: monsterType = HUMAN; break;
case 30: monsterType = TROLL; break;
case 35: monsterType = SHOPKEEPER; break;
case 36: monsterType = GOBLIN; break;
case 48: monsterType = SPIDER; break;
case 62: monsterType = LICH; break;
case 70: monsterType = GNOME; break;
case 71: monsterType = DEVIL; break;
case 75: monsterType = DEMON; break;
case 76: monsterType = CREATURE_IMP; break;
case 77: monsterType = MINOTAUR; break;
case 78: monsterType = SCORPION; break;
case 79: monsterType = SLIME; break;
case 193: monsterType = SLIME; break;
case 194: monsterType = SLIME; break;
case 195: monsterType = SLIME; break;
case 196: monsterType = SLIME; break;
case 197: monsterType = SLIME; break;
case 80: monsterType = SUCCUBUS; break;
case 81: monsterType = RAT; break;
case 82: monsterType = GHOUL; break;
case 83: monsterType = SKELETON; break;
case 84: monsterType = KOBOLD; break;
case 85: monsterType = SCARAB; break;
case 86: monsterType = CRYSTALGOLEM; break;
case 87: monsterType = INCUBUS; break;
case 88: monsterType = VAMPIRE; break;
case 89: monsterType = SHADOW; break;
case 90: monsterType = COCKATRICE; break;
case 91: monsterType = INSECTOID; break;
case 92: monsterType = GOATMAN; break;
case 93: monsterType = AUTOMATON; break;
case 94: monsterType = LICH_ICE; break;
case 95: monsterType = LICH_FIRE; break;
case 163: monsterType = SENTRYBOT; break;
case 164: monsterType = SPELLBOT; break;
case 165: monsterType = DUMMYBOT; break;
case 166: monsterType = GYROBOT; break;
case 188: monsterType = BAT_SMALL; break;
case 189: monsterType = BUGBEAR; break;
default:
break;
}
return monsterType;
}

int checkSpriteType(Sint32 sprite)
{
Expand Down
47 changes: 3 additions & 44 deletions src/maps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6138,51 +6138,11 @@ void assignActions(map_t* map)
//Assign entity creature list pointer.
entity->addToCreatureList(map->creatures);

Monster monsterType = SKELETON;
Monster monsterType = editorSpriteTypeToMonster(entity->sprite);
bool monsterIsFixedSprite = true;

switch (entity->sprite) {
case 27: monsterType = HUMAN; break;
case 30: monsterType = TROLL; break;
case 35: monsterType = SHOPKEEPER; break;
case 36: monsterType = GOBLIN; break;
case 48: monsterType = SPIDER; break;
case 62: monsterType = LICH; break;
case 70: monsterType = GNOME; break;
case 71: monsterType = DEVIL; break;
case 75: monsterType = DEMON; break;
case 76: monsterType = CREATURE_IMP; break;
case 77: monsterType = MINOTAUR; break;
case 78: monsterType = SCORPION; break;
case 79: monsterType = SLIME; break;
case 193: monsterType = SLIME; break;
case 194: monsterType = SLIME; break;
case 195: monsterType = SLIME; break;
case 196: monsterType = SLIME; break;
case 197: monsterType = SLIME; break;
case 80: monsterType = SUCCUBUS; break;
case 81: monsterType = RAT; break;
case 82: monsterType = GHOUL; break;
case 83: monsterType = SKELETON; break;
case 84: monsterType = KOBOLD; break;
case 85: monsterType = SCARAB; break;
case 86: monsterType = CRYSTALGOLEM; break;
case 87: monsterType = INCUBUS; break;
case 88: monsterType = VAMPIRE; break;
case 89: monsterType = SHADOW; break;
case 90: monsterType = COCKATRICE; break;
case 91: monsterType = INSECTOID; break;
case 92: monsterType = GOATMAN; break;
case 93: monsterType = AUTOMATON; break;
case 94: monsterType = LICH_ICE; break;
case 95: monsterType = LICH_FIRE; break;
case 163: monsterType = SENTRYBOT; break;
case 164: monsterType = SPELLBOT; break;
case 165: monsterType = DUMMYBOT; break;
case 166: monsterType = GYROBOT; break;
case 188: monsterType = BAT_SMALL; break;
case 189: monsterType = BUGBEAR; break;
default:
if ( monsterType == NOTHING )
{
monsterIsFixedSprite = false;
monsterType = static_cast<Monster>(monsterCurve(currentlevel));
if ( customMonsterCurveExists )
Expand All @@ -6197,7 +6157,6 @@ void assignActions(map_t* map)
customMonsterCurveExists = false;
}
}
break;
}

if ( monsterType == MIMIC )
Expand Down
1 change: 1 addition & 0 deletions src/net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1980,6 +1980,7 @@ void clientActions(Entity* entity)
{
case -4:
entity->behavior = &actMonster;
entity->skill[2] = -4;
break;
case -5:
entity->behavior = &actItem;
Expand Down
2 changes: 1 addition & 1 deletion src/ui/MainMenu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37428,7 +37428,7 @@ namespace MainMenu {
{
contents->remove(i->name.c_str());
}
if ( i->name == "notif" )
else if ( i->name == "notif" )
{
contents->remove(i->name.c_str());
}
Expand Down

0 comments on commit 750900f

Please sign in to comment.