mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-06-16 05:13:58 -07:00
fix(atlas): Fix ship placement in Atlas
- Changed the obstruction check to use the unit's passability class. Ref: https://code.wildfiregames.com/rP16149 Fix: #8053
This commit is contained in:
parent
7938a120d1
commit
e6ad1141fd
7 changed files with 25 additions and 19 deletions
|
|
@ -267,25 +267,25 @@
|
|||
<Entity uid="65">
|
||||
<Template>units/athen/ship_fishing</Template>
|
||||
<Player>1</Player>
|
||||
<Position x="313.99878" z="106.94742"/>
|
||||
<Position x="325.99878" z="97.94742"/>
|
||||
<Orientation y="1.60703"/>
|
||||
</Entity>
|
||||
<Entity uid="66">
|
||||
<Template>units/athen/ship_fishing</Template>
|
||||
<Player>1</Player>
|
||||
<Position x="339.35697" z="162.01983"/>
|
||||
<Position x="345.55298" z="146.85743"/>
|
||||
<Orientation y="2.40772"/>
|
||||
</Entity>
|
||||
<Entity uid="67">
|
||||
<Template>units/athen/ship_fishing</Template>
|
||||
<Player>1</Player>
|
||||
<Position x="343.68882" z="166.46813"/>
|
||||
<Position x="358.60004" z="160.28962"/>
|
||||
<Orientation y="2.39055"/>
|
||||
</Entity>
|
||||
<Entity uid="68">
|
||||
<Template>units/athen/ship_fishing</Template>
|
||||
<Player>1</Player>
|
||||
<Position x="313.93851" z="113.20711"/>
|
||||
<Position x="330.32187" z="115.86803"/>
|
||||
<Orientation y="1.76275"/>
|
||||
</Entity>
|
||||
<Entity uid="70">
|
||||
|
|
@ -1791,13 +1791,13 @@
|
|||
<Entity uid="344">
|
||||
<Template>units/athen/ship_fishing</Template>
|
||||
<Player>1</Player>
|
||||
<Position x="129.92458" z="457.09577"/>
|
||||
<Position x="124.98847" z="474.15561"/>
|
||||
<Orientation y="-0.62937"/>
|
||||
</Entity>
|
||||
<Entity uid="347">
|
||||
<Template>units/athen/ship_fishing</Template>
|
||||
<Player>1</Player>
|
||||
<Position x="125.52878" z="453.59147"/>
|
||||
<Position x="110.78371" z="463.38596"/>
|
||||
<Orientation y="-0.65941"/>
|
||||
</Entity>
|
||||
<Entity uid="348">
|
||||
|
|
@ -6585,4 +6585,4 @@
|
|||
</Entity>
|
||||
</Entities>
|
||||
<Paths/>
|
||||
</Scenario>
|
||||
</Scenario>
|
||||
|
|
|
|||
|
|
@ -81203,14 +81203,14 @@
|
|||
<Entity uid="16075">
|
||||
<Template>units/kush/ship_scout</Template>
|
||||
<Player>0</Player>
|
||||
<Position x="1937.27222" z="1006.42133"/>
|
||||
<Position x="1941.27222" z="1010.42133"/>
|
||||
<Orientation y="-1.6437"/>
|
||||
<Actor seed="62640"/>
|
||||
</Entity>
|
||||
<Entity uid="16076">
|
||||
<Template>units/kush/ship_scout</Template>
|
||||
<Player>0</Player>
|
||||
<Position x="1921.01893" z="909.52625"/>
|
||||
<Position x="1918.01893" z="902.52625"/>
|
||||
<Orientation y="1.43442"/>
|
||||
<Actor seed="41755"/>
|
||||
</Entity>
|
||||
|
|
|
|||
|
|
@ -30672,7 +30672,7 @@
|
|||
<Entity uid="6237">
|
||||
<Template>units/spart/ship_arrow</Template>
|
||||
<Player>2</Player>
|
||||
<Position x="934.4372" z="400.35584"/>
|
||||
<Position x="935.4372" z="400.35584"/>
|
||||
<Orientation y="-0.52605"/>
|
||||
<Actor seed="924"/>
|
||||
</Entity>
|
||||
|
|
@ -30693,7 +30693,7 @@
|
|||
<Entity uid="6240">
|
||||
<Template>units/athen/ship_arrow</Template>
|
||||
<Player>5</Player>
|
||||
<Position x="938.22236" z="1128.07532"/>
|
||||
<Position x="940.22236" z="1129.07532"/>
|
||||
<Orientation y="2.35621"/>
|
||||
<Actor seed="4236"/>
|
||||
</Entity>
|
||||
|
|
@ -30792,4 +30792,4 @@
|
|||
</Entity>
|
||||
</Entities>
|
||||
<Paths/>
|
||||
</Scenario>
|
||||
</Scenario>
|
||||
|
|
|
|||
|
|
@ -23278,7 +23278,7 @@
|
|||
<Entity uid="5170">
|
||||
<Template>units/pirates/ship_scout</Template>
|
||||
<Player>0</Player>
|
||||
<Position x="991.45337" z="1261.83448"/>
|
||||
<Position x="987.45337" z="1260.83448"/>
|
||||
<Orientation y="-2.88268"/>
|
||||
<Actor seed="57714"/>
|
||||
</Entity>
|
||||
|
|
|
|||
|
|
@ -67990,7 +67990,7 @@
|
|||
<Entity uid="15023">
|
||||
<Template>units/mace/ship_fishing</Template>
|
||||
<Player>0</Player>
|
||||
<Position x="1947.2776" z="807.69501"/>
|
||||
<Position x="1948.2776" z="808.69501"/>
|
||||
<Orientation y="0.10067"/>
|
||||
<Actor seed="38656"/>
|
||||
</Entity>
|
||||
|
|
|
|||
|
|
@ -104,28 +104,28 @@
|
|||
<Entity uid="11">
|
||||
<Template>skirmish/units/default_ship_arrow</Template>
|
||||
<Player>2</Player>
|
||||
<Position x="626.89252" z="205.15238"/>
|
||||
<Position x="625.69239" z="199.89383"/>
|
||||
<Orientation y="-3.02076"/>
|
||||
<Actor seed="26956"/>
|
||||
</Entity>
|
||||
<Entity uid="12">
|
||||
<Template>skirmish/units/default_ship_arrow</Template>
|
||||
<Player>3</Player>
|
||||
<Position x="866.38605" z="222.42289"/>
|
||||
<Position x="856.56336" z="217.10535"/>
|
||||
<Orientation y="-3.0844"/>
|
||||
<Actor seed="50188"/>
|
||||
</Entity>
|
||||
<Entity uid="13">
|
||||
<Template>skirmish/units/default_ship_arrow</Template>
|
||||
<Player>4</Player>
|
||||
<Position x="726.61884" z="210.01325"/>
|
||||
<Position x="725.77344" z="205.33576"/>
|
||||
<Orientation y="-3.12066"/>
|
||||
<Actor seed="36860"/>
|
||||
</Entity>
|
||||
<Entity uid="14">
|
||||
<Template>skirmish/units/default_ship_arrow</Template>
|
||||
<Player>5</Player>
|
||||
<Position x="986.77491" z="233.57181"/>
|
||||
<Position x="996.7447" z="228.77668"/>
|
||||
<Orientation y="2.73601"/>
|
||||
<Actor seed="12196"/>
|
||||
</Entity>
|
||||
|
|
|
|||
|
|
@ -42,6 +42,7 @@
|
|||
#include "renderer/WaterManager.h"
|
||||
#include "simulation2/Simulation2.h"
|
||||
#include "simulation2/components/ICmpObstruction.h"
|
||||
#include "simulation2/components/ICmpUnitMotion.h"
|
||||
#include "simulation2/components/ICmpOwnership.h"
|
||||
#include "simulation2/components/ICmpPosition.h"
|
||||
#include "simulation2/components/ICmpPlayer.h"
|
||||
|
|
@ -69,7 +70,12 @@ bool CheckEntityObstruction(entity_id_t ent)
|
|||
CmpPtr<ICmpObstruction> cmpObstruction(*g_Game->GetSimulation2(), ent);
|
||||
if (cmpObstruction)
|
||||
{
|
||||
ICmpObstruction::EFoundationCheck result = cmpObstruction->CheckFoundation("default");
|
||||
std::string passClassName = "default";
|
||||
CmpPtr<ICmpUnitMotion> cmpUnitMotion(*g_Game->GetSimulation2(), ent);
|
||||
if (cmpUnitMotion)
|
||||
passClassName = cmpUnitMotion->GetPassabilityClassName();
|
||||
|
||||
ICmpObstruction::EFoundationCheck result = cmpObstruction->CheckFoundation(passClassName);
|
||||
if (result != ICmpObstruction::FOUNDATION_CHECK_SUCCESS)
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue