mirror of
https://github.com/moparisthebest/minetest
synced 2025-01-11 05:38:01 -05:00
Decoration: Stop DecoSimple::resolveNodeNames from complaining about no node name if decolist is used
Fix warning message for spawnby nodes Prevent type-punning warning caused by casting enum to int
This commit is contained in:
parent
e396fb2984
commit
cca4f09ba1
@ -382,7 +382,7 @@ void Decoration::placeCutoffs(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax)
|
|||||||
void DecoSimple::resolveNodeNames(INodeDefManager *ndef) {
|
void DecoSimple::resolveNodeNames(INodeDefManager *ndef) {
|
||||||
Decoration::resolveNodeNames(ndef);
|
Decoration::resolveNodeNames(ndef);
|
||||||
|
|
||||||
if (c_deco == CONTENT_IGNORE) {
|
if (c_deco == CONTENT_IGNORE && !decolist_names.size()) {
|
||||||
c_deco = ndef->getId(deco_name);
|
c_deco = ndef->getId(deco_name);
|
||||||
if (c_deco == CONTENT_IGNORE) {
|
if (c_deco == CONTENT_IGNORE) {
|
||||||
errorstream << "DecoSimple::resolveNodeNames: decoration node '"
|
errorstream << "DecoSimple::resolveNodeNames: decoration node '"
|
||||||
@ -394,7 +394,7 @@ void DecoSimple::resolveNodeNames(INodeDefManager *ndef) {
|
|||||||
c_spawnby = ndef->getId(spawnby_name);
|
c_spawnby = ndef->getId(spawnby_name);
|
||||||
if (c_spawnby == CONTENT_IGNORE) {
|
if (c_spawnby == CONTENT_IGNORE) {
|
||||||
errorstream << "DecoSimple::resolveNodeNames: spawnby node '"
|
errorstream << "DecoSimple::resolveNodeNames: spawnby node '"
|
||||||
<< deco_name << "' not defined" << std::endl;
|
<< spawnby_name << "' not defined" << std::endl;
|
||||||
nspawnby = -1;
|
nspawnby = -1;
|
||||||
c_spawnby = CONTENT_AIR;
|
c_spawnby = CONTENT_AIR;
|
||||||
}
|
}
|
||||||
|
@ -522,11 +522,11 @@ int ModApiMapgen::l_place_schematic(lua_State *L)
|
|||||||
if (!read_schematic(L, 2, &dschem, getServer(L)))
|
if (!read_schematic(L, 2, &dschem, getServer(L)))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
Rotation rot = ROTATE_0;
|
int rot = ROTATE_0;
|
||||||
if (lua_isstring(L, 3))
|
if (lua_isstring(L, 3))
|
||||||
string_to_enum(es_Rotation, (int &)rot, std::string(lua_tostring(L, 3)));
|
string_to_enum(es_Rotation, rot, std::string(lua_tostring(L, 3)));
|
||||||
|
|
||||||
dschem.rotation = rot;
|
dschem.rotation = (Rotation)rot;
|
||||||
|
|
||||||
if (lua_istable(L, 4)) {
|
if (lua_istable(L, 4)) {
|
||||||
int index = 4;
|
int index = 4;
|
||||||
|
Loading…
Reference in New Issue
Block a user