diff options
Diffstat (limited to 'extension')
m--------- | extension/deps/openvic-simulation | 0 | ||||
-rw-r--r-- | extension/src/openvic-extension/singletons/MapItemSingleton.cpp | 5 |
2 files changed, 4 insertions, 1 deletions
diff --git a/extension/deps/openvic-simulation b/extension/deps/openvic-simulation -Subproject cb1b56b0146d32c881abd48f53e85f7cf8283be +Subproject e15bbf98879e797bf9161e0cb2a6b3a3cdf35df diff --git a/extension/src/openvic-extension/singletons/MapItemSingleton.cpp b/extension/src/openvic-extension/singletons/MapItemSingleton.cpp index d62e0fd..5b2127b 100644 --- a/extension/src/openvic-extension/singletons/MapItemSingleton.cpp +++ b/extension/src/openvic-extension/singletons/MapItemSingleton.cpp @@ -122,6 +122,7 @@ TypedArray<Dictionary> MapItemSingleton::get_billboards(){ return ret; } +//dont use this, it includes water provinces int MapItemSingleton::get_province_count(){ GameSingleton const* game_singleton = GameSingleton::get_singleton(); ERR_FAIL_NULL_V(game_singleton, 0); @@ -143,8 +144,10 @@ PackedVector2Array MapItemSingleton::get_province_positions(){ Logger::info("prov_count ", prov_count); for(int i = 0; i < prov_count; i++){ + //i+1 because the province indices are 1 based (0 causes an error) ProvinceDefinition const* prov = game_singleton->get_definition_manager() .get_map_definition().get_province_definition_by_index(i+1); + if(prov->is_water()) continue; //billboards dont appear over water, skip fvec2_t city_pos = prov->get_city_position(); Vector2 pos = Utilities::to_godot_fvec2(city_pos) / game_singleton->get_map_dims(); @@ -155,6 +158,6 @@ PackedVector2Array MapItemSingleton::get_province_positions(){ //province_dict[position_key] = Utilities::to_godot_fvec2(province.get_text_position()) / get_map_dims(); } - + return billboard_pos; }
\ No newline at end of file |