mirror of
https://github.com/neoStudiosLCE/neoLegacy.git
synced 2026-08-20 09:57:09 +00:00
fix: misc crashes
This commit is contained in:
parent
e2b81cae79
commit
3409dfb821
|
|
@ -205,8 +205,19 @@ public:
|
||||||
|
|
||||||
wstring getString(const wstring &name)
|
wstring getString(const wstring &name)
|
||||||
{
|
{
|
||||||
if (tags.find(name) == tags.end()) return wstring( L"" );
|
auto it = tags.find(name);
|
||||||
return static_cast<StringTag *>(tags[name])->data;
|
|
||||||
|
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)
|
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);
|
int t = level->getTile(x, y, z);
|
||||||
if (t == Tile::redstone_wire_Id) return true;
|
if (t == Tile::redstone_wire_Id) return true;
|
||||||
if (t == 0) return false;
|
if (t == 0) return false;
|
||||||
|
Tile *tile = Tile::tiles[t];
|
||||||
if (Tile::unpowered_repeater->isSameDiode(t))
|
if (Tile::unpowered_repeater->isSameDiode(t))
|
||||||
{
|
{
|
||||||
int data = level->getData(x, y, z);
|
int data = level->getData(x, y, z);
|
||||||
return direction == (data & DiodeTile::DIRECTION_MASK) || direction == Direction::DIRECTION_OPPOSITE[data & DiodeTile::DIRECTION_MASK];
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,6 @@ void SlimeTile::fallOn(Level *level, int x, int y, int z,
|
||||||
entity->clearFallDamageQueue();
|
entity->clearFallDamageQueue();
|
||||||
|
|
||||||
entity->fallDistance = 0.0f;
|
entity->fallDistance = 0.0f;
|
||||||
entity->onGround = false;
|
|
||||||
|
|
||||||
if (entity->isSneaking())
|
if (entity->isSneaking())
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue