Ticket #531 (closed task: fixed)
Enforce Population Limit
| Reported by: | evans | Owned by: | evans |
|---|---|---|---|
| Priority: | Should Have | Milestone: | Alpha 2 |
| Component: | UI & Simulation | Keywords: | review |
| Cc: | philip |
Description
Enforce Population Limit when training units. Units can be queued up for training past the population limit, but training will start only when there are enough population slots available.
Attachments
Change History
comment:1 Changed 3 years ago by Philip
Made some changes here:
- Added a global QueryOwnerInterface function (instead of the GetPlayer), so we can get the player data from anywhere.
- Changed the OwnershipChanged behaviour so it simply destroys the current queue on each change.
- "" should always be followed by a space.
- I think the !item.trainingStarted case would result in item.timeRemaining becoming negative and the unit not being trained immediately, if it started smaller than time (which is unlikely but possible), so I changed that.
- Also tried to simplify some of the logic around updating the population reserve count.
- Maybe some minor things I lost track of.
comment:4 Changed 3 years ago by fcxSanya
- Status changed from closed to reopened
- Resolution fixed deleted
In [8014] PopulationBonus element was made necessary from optional, but in source\simulation2\components\CCmpTemplateManager.cpp, CopyFoundationSubset function, there is lines:
if (out.GetChild("Entity").GetChild("Cost").IsOk())
CParamNode::LoadXMLString(
out, "<Entity><Cost><PopulationBonus disable=''/></Cost></Entity>"
);
which disable this element for structures foundation.
So when I try to build a structure, I get error like this:
ERROR: CXeromyces: Parse error: foundation%7Cstructures/hele_barracks:1:
Expecting an element PopulationBonus, got nothing
ERROR: CXeromyces: Parse error: foundation%7Cstructures/hele_barracks:1:
Invalid sequence in interleave
ERROR: CXeromyces: Parse error: foundation%7Cstructures/hele_barracks:1:
Element Cost failed to validate content
ERROR: RelaxNGValidator: Validation failed
ERROR: JavaScript error: simulation/helpers/Commands.js line 84 TypeError:
cmpPosition is null
ERROR: Failed to call ProcessCommand() global script function
When I comment this lines:
if (out.GetChild("Entity").GetChild("Cost").IsOk())
CParamNode::LoadXMLString(
out, "<Entity><Cost><PopulationBonus disable=''/></Cost></Entity>"
);
all works properly.
comment:6 Changed 3 years ago by Philip
- Status changed from reopened to closed
- Resolution set to fixed
Note: See
TracTickets for help on using
tickets.
