Skip to content

Commit cca4f09

Browse files
committedNov 17, 2013
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
1 parent e396fb2 commit cca4f09

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed
 

‎src/mapgen.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ void Decoration::placeCutoffs(Mapgen *mg, u32 blockseed, v3s16 nmin, v3s16 nmax)
382382
void DecoSimple::resolveNodeNames(INodeDefManager *ndef) {
383383
Decoration::resolveNodeNames(ndef);
384384

385-
if (c_deco == CONTENT_IGNORE) {
385+
if (c_deco == CONTENT_IGNORE && !decolist_names.size()) {
386386
c_deco = ndef->getId(deco_name);
387387
if (c_deco == CONTENT_IGNORE) {
388388
errorstream << "DecoSimple::resolveNodeNames: decoration node '"
@@ -394,7 +394,7 @@ void DecoSimple::resolveNodeNames(INodeDefManager *ndef) {
394394
c_spawnby = ndef->getId(spawnby_name);
395395
if (c_spawnby == CONTENT_IGNORE) {
396396
errorstream << "DecoSimple::resolveNodeNames: spawnby node '"
397-
<< deco_name << "' not defined" << std::endl;
397+
<< spawnby_name << "' not defined" << std::endl;
398398
nspawnby = -1;
399399
c_spawnby = CONTENT_AIR;
400400
}

‎src/script/lua_api/l_mapgen.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -522,11 +522,11 @@ int ModApiMapgen::l_place_schematic(lua_State *L)
522522
if (!read_schematic(L, 2, &dschem, getServer(L)))
523523
return 0;
524524

525-
Rotation rot = ROTATE_0;
525+
int rot = ROTATE_0;
526526
if (lua_isstring(L, 3))
527-
string_to_enum(es_Rotation, (int &)rot, std::string(lua_tostring(L, 3)));
527+
string_to_enum(es_Rotation, rot, std::string(lua_tostring(L, 3)));
528528

529-
dschem.rotation = rot;
529+
dschem.rotation = (Rotation)rot;
530530

531531
if (lua_istable(L, 4)) {
532532
int index = 4;

0 commit comments

Comments
 (0)
Please sign in to comment.