mirror of
https://github.com/glest/glest-source.git
synced 2025-02-25 04:02:30 +01:00
- updated unitid offset for each faction so that we support up to 100,000 units per faction per game (which is larger than previously supported)
This commit is contained in:
parent
8ea52485cc
commit
fc63460e07
@ -61,12 +61,12 @@ enum NetworkCommandType {
|
||||
class NetworkCommand{
|
||||
private:
|
||||
int16 networkCommandType;
|
||||
int16 unitId;
|
||||
int32 unitId;
|
||||
int16 commandTypeId;
|
||||
int16 positionX;
|
||||
int16 positionY;
|
||||
int16 unitTypeId;
|
||||
int16 targetId;
|
||||
int32 targetId;
|
||||
int16 wantQueue;
|
||||
int16 fromFactionIndex;
|
||||
int16 unitFactionUnitCount;
|
||||
|
@ -814,9 +814,15 @@ void World::computeFow(){
|
||||
}
|
||||
}
|
||||
|
||||
// WARNING! This id is critical! MAke sure it fits inside the network packet
|
||||
// (currently cannot be larger than 2,147,483,647)
|
||||
// Make sure each faction has their own unique section of id #'s for proper
|
||||
// multi-platform play
|
||||
// Calculates the unit unit ID for each faction
|
||||
//
|
||||
int World::getNextUnitId(Faction *faction) {
|
||||
if(mapFactionNextUnitId.find(faction->getIndex()) == mapFactionNextUnitId.end()) {
|
||||
mapFactionNextUnitId[faction->getIndex()] = faction->getIndex() * 3000;
|
||||
mapFactionNextUnitId[faction->getIndex()] = faction->getIndex() * 100000;
|
||||
}
|
||||
return mapFactionNextUnitId[faction->getIndex()]++;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user