mirror of
https://github.com/neoStudiosLCE/neoLegacy.git
synced 2026-06-16 11:02:54 +00:00
fix: misc crashes
This commit is contained in:
parent
e2b81cae79
commit
3409dfb821
|
|
@ -205,8 +205,19 @@ public:
|
|||
|
||||
wstring getString(const wstring &name)
|
||||
{
|
||||
if (tags.find(name) == tags.end()) return wstring( L"" );
|
||||
return static_cast<StringTag *>(tags[name])->data;
|
||||
auto it = tags.find(name);
|
||||
|
||||
if (it == tags.end())
|
||||
return L"";
|
||||
|
||||
Tag* tag = it->second;
|
||||
|
||||
if (!tag || tag->getId() != Tag::TAG_STRING)
|
||||
return L"";
|
||||
|
||||
StringTag* stringTag = static_cast<StringTag*>(tag);
|
||||
|
||||
return stringTag->data;
|
||||
}
|
||||
|
||||
byteArray getByteArray(const wstring &name)
|
||||
|
|
|
|||
|
|
@ -383,12 +383,13 @@ bool RedStoneDustTile::shouldConnectTo(LevelSource *level, int x, int y, int z,
|
|||
int t = level->getTile(x, y, z);
|
||||
if (t == Tile::redstone_wire_Id) return true;
|
||||
if (t == 0) return false;
|
||||
Tile *tile = Tile::tiles[t];
|
||||
if (Tile::unpowered_repeater->isSameDiode(t))
|
||||
{
|
||||
int data = level->getData(x, y, z);
|
||||
return direction == (data & DiodeTile::DIRECTION_MASK) || direction == Direction::DIRECTION_OPPOSITE[data & DiodeTile::DIRECTION_MASK];
|
||||
}
|
||||
else if (Tile::tiles[t]->isSignalSource() && direction != Direction::UNDEFINED) return true;
|
||||
else if (tile != nullptr && tile->isSignalSource() && direction != Direction::UNDEFINED) return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,6 @@ void SlimeTile::fallOn(Level *level, int x, int y, int z,
|
|||
entity->clearFallDamageQueue();
|
||||
|
||||
entity->fallDistance = 0.0f;
|
||||
entity->onGround = false;
|
||||
|
||||
if (entity->isSneaking())
|
||||
return;
|
||||
|
|
|
|||
Loading…
Reference in a new issue