More Tiny Fixes!
This commit is contained in:
parent
723d5160c8
commit
adf92124c3
@ -189,7 +189,7 @@ static const std::string player_namespace = "player.";
|
||||
(void) 0
|
||||
#define next_int(out) next_number(out, int, std::stoi)
|
||||
#define next_float(out) next_number(out, float, std::stof)
|
||||
std::string CommandServer_parse_injection(CommandServer_parse_t old, CommandServer *server, ConnectedClient &client, const std::string &command) {
|
||||
static std::string CommandServer_parse_injection(CommandServer_parse_t original, CommandServer *server, ConnectedClient &client, const std::string &command) {
|
||||
// Parse Command
|
||||
size_t arg_start = command.find('(');
|
||||
if (arg_start == std::string::npos) {
|
||||
@ -515,7 +515,7 @@ sign->lines[i] = api_get_input(line_##i); \
|
||||
} else {
|
||||
// Call Original Method
|
||||
api_suppress_chat_events = client.sock >= 0; // Suppress If Real API Client
|
||||
std::string ret = old(server, client, command);
|
||||
std::string ret = original(server, client, command);
|
||||
api_suppress_chat_events = false;
|
||||
return ret;
|
||||
}
|
||||
|
@ -90,6 +90,7 @@ void api_convert_to_outside_entity_type(int &type) {
|
||||
for (const std::pair<const int, EntityType> &pair : modern_entity_id_mapping) {
|
||||
if (static_cast<int>(pair.second) == type) {
|
||||
type = pair.first;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -206,10 +206,32 @@ std::map<EntityType, std::pair<std::string, std::string>> &misc_get_entity_type_
|
||||
|
||||
// Spawn Entities
|
||||
Entity *misc_make_entity_from_id(Level *level, const int id) {
|
||||
if (id < 0x40) {
|
||||
if (id < static_cast<int>(EntityType::DROPPED_ITEM)) {
|
||||
// Spwn Mob
|
||||
return (Entity *) MobFactory::CreateMob(id, level);
|
||||
} else {
|
||||
return EntityFactory::CreateEntity(id, level);
|
||||
// Spawn Entity
|
||||
Entity *entity = EntityFactory::CreateEntity(id, level);
|
||||
switch (id) {
|
||||
case static_cast<int>(EntityType::PAINTING): {
|
||||
// Fix Crash
|
||||
((Painting *) entity)->motive = Motive::DefaultImage;
|
||||
break;
|
||||
}
|
||||
case static_cast<int>(EntityType::FALLING_SAND): {
|
||||
// Sensible Default
|
||||
FallingTile *sand = (FallingTile *) entity;
|
||||
sand->tile_id = Tile::sand->id;
|
||||
sand->time = 1;
|
||||
break;
|
||||
}
|
||||
case static_cast<int>(EntityType::DROPPED_ITEM): {
|
||||
// Sensible Default
|
||||
((ItemEntity *) entity)->item.constructor_item(Item::sword_iron);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return entity;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -71,9 +71,13 @@ set(SRC
|
||||
src/entity/ItemEntity.def
|
||||
src/entity/Arrow.def
|
||||
src/entity/ArrowRenderer.def
|
||||
src/entity/PaintingRenderer.def
|
||||
src/entity/Throwable.def
|
||||
src/entity/Particle.def
|
||||
src/entity/painting/Painting.def
|
||||
src/entity/painting/PaintingRenderer.def
|
||||
src/entity/painting/HangingEntity.def
|
||||
src/entity/painting/Motive.def
|
||||
src/entity/FallingTile.def
|
||||
src/level/container/FillingContainer.def
|
||||
src/level/container/Container.def
|
||||
src/level/container/ContainerMenu.def
|
||||
|
7
symbols/src/entity/FallingTile.def
Normal file
7
symbols/src/entity/FallingTile.def
Normal file
@ -0,0 +1,7 @@
|
||||
extends Entity;
|
||||
|
||||
vtable 0x10c460;
|
||||
|
||||
property int tile_id = 0xd0;
|
||||
property int data = 0xd4;
|
||||
property int time = 0xd8;
|
3
symbols/src/entity/painting/HangingEntity.def
Normal file
3
symbols/src/entity/painting/HangingEntity.def
Normal file
@ -0,0 +1,3 @@
|
||||
extends Entity;
|
||||
|
||||
vtable 0x10aba8;
|
1
symbols/src/entity/painting/Motive.def
Normal file
1
symbols/src/entity/painting/Motive.def
Normal file
@ -0,0 +1 @@
|
||||
static-property Motive *DefaultImage = 0x135dc0;
|
5
symbols/src/entity/painting/Painting.def
Normal file
5
symbols/src/entity/painting/Painting.def
Normal file
@ -0,0 +1,5 @@
|
||||
extends HangingEntity;
|
||||
|
||||
vtable 0x10b0b0;
|
||||
|
||||
property Motive *motive = 0xe4;
|
@ -97,6 +97,7 @@ static-property Tile *bedrock = 0x181cc4;
|
||||
static-property Tile *tallgrass = 0x181d0c;
|
||||
static-property Tile *stoneSlab = 0x181b44;
|
||||
static-property Tile *fire = 0x181de0;
|
||||
static-property Tile *sand = 0x181b20;
|
||||
|
||||
// "Carried" Tiles
|
||||
static-property Tile *leaves_carried = 0x181dd8;
|
||||
|
Loading…
x
Reference in New Issue
Block a user