MCPcopy Create free account
hub / github.com/Warzone2100/warzone2100 / structureBodyBuilt

Function structureBodyBuilt

src/structure.cpp:5875–5888  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5873}
5874
5875unsigned structureBodyBuilt(const STRUCTURE *psStructure)
5876{
5877 unsigned maxBody = psStructure->structureBody();
5878
5879 if (psStructure->status == SS_BEING_BUILT)
5880 {
5881 // Calculate the body points the structure would have, if not damaged.
5882 unsigned unbuiltBody = (maxBody + 9) / 10; // See droidStartBuild() in droid.cpp.
5883 unsigned deltaBody = static_cast<unsigned>(maxBody * 9 * structureCompletionProgress(*psStructure) / 10); // See structureBuild() in structure.cpp.
5884 maxBody = unbuiltBody + deltaBody;
5885 }
5886
5887 return maxBody;
5888}
5889
5890/*Access functions for the upgradeable stats of a structure*/
5891uint32_t STRUCTURE::structureBody() const

Callers 2

getStructureDamageFunction · 0.85
queueStructureHealthFunction · 0.85

Calls 2

structureBodyMethod · 0.80

Tested by

no test coverage detected