Comments (1)
The problem is that the serf count is saved/loaded as a player property, each serf if also counted individually, each serf except generic serfs are therefore counted twice. For each save/load the numbers get more corrupt. Ugly fix:
From:
for (int i = 0; i < 26; ++i)
{
state.ResourceCounts[i] = reader.Value("resource_count")[i].ReadUInt();
settings.FlagPriorities[i] = (byte)reader.Value("flag_prio")[i].ReadInt();
state.SerfCounts[i] = reader.Value("serf_count")[i].ReadUInt();
settings.InventoryPriorities[i] = (byte)reader.Value("inventory_prio")[i].ReadInt();
}
state.SerfCounts[26] = reader.Value("serf_count")[26].ReadUInt();
To:
for (int i = 0; i < Global.NUM_RESOURCE_TYPES; ++i)
{
state.ResourceCounts[i] = reader.Value("resource_count")[i].ReadUInt();
settings.FlagPriorities[i] = (byte)reader.Value("flag_prio")[i].ReadInt();
settings.InventoryPriorities[i] = (byte)reader.Value("inventory_prio")[i].ReadInt();
}
// Only read generic serf count, other serfs are count when loaded
// TODO improve code quality, handle generic serfs the same way as all other serfs?
state.SerfCounts[21] = reader.Value("serf_count")[21].ReadUInt();
from freeserf.net.
Related Issues (20)
- Production graphs and x axis does not match HOT 2
- Endless military power
- Building count not correct HOT 2
- Broken save game
- Knight walkin in and out of castle
- Land
- Crash when conquering enemy castle HOT 5
- Border stuck on screen
- Crash when losing fight
- Free graphism
- No notification when conquering enemy castle
- Material production cycle chart HOT 1
- Production graph gap
- Stuck serf
- Fight in water
- Knight walking back and forth
- Crash
- Missing feature: map building filter
- Geologist finds resources when there is none
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from freeserf.net.