From 123de7fdf795d7962a0fd2ca347bca013e67080f Mon Sep 17 00:00:00 2001 From: Pauli Date: Fri, 22 Jun 2018 15:51:03 +0300 Subject: [PATCH 1/2] Use constexpr to prevent attempts of linking static variable --- library/include/modules/MapCache.h | 2 +- library/modules/MapCache.cpp | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/library/include/modules/MapCache.h b/library/include/modules/MapCache.h index 73a91d972..70ba0a858 100644 --- a/library/include/modules/MapCache.h +++ b/library/include/modules/MapCache.h @@ -55,7 +55,7 @@ class Block; struct BiomeInfo { // Determined by the 4-bit index in the designation bitfield - static const unsigned MAX_LAYERS = 16; + static constexpr unsigned MAX_LAYERS = 16; df::coord2d pos; int default_soil, default_stone, lava_stone; diff --git a/library/modules/MapCache.cpp b/library/modules/MapCache.cpp index d5c2e6c81..85df6156f 100644 --- a/library/modules/MapCache.cpp +++ b/library/modules/MapCache.cpp @@ -79,10 +79,6 @@ using df::global::world; extern bool GetLocalFeature(t_feature &feature, df::coord2d rgn_pos, int32_t index); -#ifdef LINUX_BUILD -const unsigned MapExtras::BiomeInfo::MAX_LAYERS; -#endif - const BiomeInfo MapCache::biome_stub = { df::coord2d(), -1, -1, -1, -1, From 20bd03ab6d578c53258f8efbbfbeb7a9b182e242 Mon Sep 17 00:00:00 2001 From: Pauli Date: Fri, 22 Jun 2018 15:56:39 +0300 Subject: [PATCH 2/2] Reset dsgn_check_cooldown in Block::write To make sure that DF generates jobjs from desgination as soon as possible the dsgn_check_cooldown should be reset when designations change. --- library/modules/MapCache.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/library/modules/MapCache.cpp b/library/modules/MapCache.cpp index 85df6156f..bbb592c2d 100644 --- a/library/modules/MapCache.cpp +++ b/library/modules/MapCache.cpp @@ -738,6 +738,7 @@ bool MapExtras::Block::Write () { COPY(block->designation, designation); block->flags.bits.designated = true; + block->dsgn_check_cooldown = 0; dirty_designations = false; } if(dirty_tiles || dirty_veins)