Ticket #3530: SaveTheChickenNotTheWhales.patch
File SaveTheChickenNotTheWhales.patch, 2.0 KB (added by , 8 years ago) |
---|
-
source/ps/TemplateLoader.cpp
394 394 CParamNode::LoadXMLString(out, "<Entity/>"); 395 395 out.CopyFilteredChildrenOfChild(in, "Entity", permittedComponentTypes); 396 396 397 // Disable the Obstruction component (if there is one) so it doesn't affect pathfinding398 // (but can still be used for testing this entity for collisions against others)399 if (out.GetChild("Entity").GetChild("Obstruction").IsOk())400 CParamNode::LoadXMLString(out, "<Entity><Obstruction><Active>false</Active></Obstruction></Entity>");401 402 397 if (!corpse) 403 398 { 404 399 // Previews should not cast shadows … … 542 537 permittedComponentTypes.insert("Position"); 543 538 permittedComponentTypes.insert("VisualActor"); 544 539 permittedComponentTypes.insert("Identity"); 545 permittedComponentTypes.insert("Obstruction");546 540 permittedComponentTypes.insert("Minimap"); 547 541 permittedComponentTypes.insert("ResourceSupply"); 548 542 permittedComponentTypes.insert("Selectable"); … … 554 548 555 549 CParamNode::LoadXMLString(out, "<Entity/>"); 556 550 out.CopyFilteredChildrenOfChild(in, "Entity", permittedComponentTypes); 551 552 // When dying, resources lose the unitmotion component 553 // This causes them to have no clearance, and an obstruction that does not really exist. 554 // Which makes the unreachable in some cases (see #3530). 555 // To fix this issue and still keep them an obstruction, they need to become static. 556 // So create a static obstruction of an arbitratry radius. 557 CParamNode::LoadXMLString(out, "<Entity><Obstruction><Active>true</Active><BlockMovement>true</BlockMovement><BlockPathfinding>true</BlockPathfinding><BlockFoundation>false</BlockFoundation><BlockConstruction>false</BlockConstruction><DisableBlockMovement>false</DisableBlockMovement><DisableBlockPathfinding>false</DisableBlockPathfinding><Static width=\"2.0\" depth=\"2.0\"/></Obstruction></Entity>"); 557 558 }