jsettlers / settlers-remake

A Remake of "The Settlers III" for Windows, Linux, Mac and Android
http://www.settlers-android-clone.com
MIT License
355 stars 101 forks source link

Global storage of good should only show values for the active player #707

Open Simulant87 opened 6 years ago

Simulant87 commented 6 years ago

As a human player I am able to see though the fog of war with the "global storage" view.

It always displays the current amount of goods in the section even through the fog of war and even if the section that is in the middle of the current view point does not belong to the active player. Its the same behavior for the buildings count.

Before returning the amount of the goods the logic should check if the sections belongs to the active player.

Also the calculated center of the Map view section is not in the center of the screen. That leads to displayed 0 values for all goods when the displayed screen is close the the border of a section but the center of the sreen is still within the section of the player.

globalstorage

I created a prove of concept on how to fix this, but the implementation is not very nice: https://github.com/Simulant87/settlers-remake/tree/POC-global-storage-only-visible-for-players-sections

Diff: https://github.com/jsettlers/settlers-remake/compare/master...Simulant87:POC-global-storage-only-visible-for-players-sections