From 489399dfb4075fa21d82f2adaf1e8220ef0d79e2 Mon Sep 17 00:00:00 2001 From: Nathan Fulton Date: Sat, 29 Apr 2017 23:04:07 -0400 Subject: [PATCH] Rotate miner south west to enter processor art2432 processor faces more towards the south west compared to the art824 processor which faced basically south. The coordinates used for the fakeMiner animation have been modified to compensate for this and the miner now rotates to the south west before entering. --- game/Miner.cpp | 10 +++++----- game/Processor.cpp | 15 +++++++++------ 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/game/Miner.cpp b/game/Miner.cpp index f27b3e1..7b71f74 100644 --- a/game/Miner.cpp +++ b/game/Miner.cpp @@ -465,7 +465,7 @@ BeginStateMachine // closest to the Processor's entrance. pgobTarget->GetPosition(&m_wptTarget); - m_wptTarget.wx += kwcTile + kwcTileHalf; + m_wptTarget.wx += kwcTileHalf; m_wptTarget.wy += (kwcTile * 2) + kwcTileHalf; SetState(kstMinerMoveToProcessor); } else { @@ -540,14 +540,14 @@ BeginStateMachine OnUpdate m_unvl.MinSkip(); - // Rotate to face south + // Rotate to face south west - if (m_dir != kdir16S) { - m_dir = TurnToward16(kdir16S, m_dir); + if (m_dir != kdir16SW) { + m_dir = TurnToward16(kdir16SW, m_dir); StartAnimation(&m_ani, m_pmuntc->anMovingStripIndices[m_dir], 0, kfAniLoop | kfAniIgnoreFirstAdvance); } else { - // When facing south send message to Processor and switch to + // When facing south west send message to Processor and switch to // guard state Gob *pgobProcessor = ggobm.GetGob(m_gidTarget); diff --git a/game/Processor.cpp b/game/Processor.cpp index 1d7ad8d..9a65bcc 100644 --- a/game/Processor.cpp +++ b/game/Processor.cpp @@ -322,7 +322,7 @@ BeginStateMachine Assert(pmnr != NULL, "out of memory!"); if (pmnr == NULL) goto lbError; - if (!pmnr->Init(m_wx + kwcTile, m_wy + (kwcTile * 2), m_pplr, 0, 0, NULL)) { + if (!pmnr->Init(m_wx, m_wy + (kwcTile * 2), m_pplr, 0, 0, NULL)) { delete pmnr; goto lbError; } @@ -337,6 +337,7 @@ BeginStateMachine m_gidMiner = pmnr->GetId(); pmnr->GetCenter(&m_wptFakeMiner); m_wptFakeMiner.wy = m_wy + WcFromTile16ths(15); + m_wptFakeMiner.wx = m_wx + WcFromTile16ths(27); pmnr->Hide(true); // Set / clear reservation / occupation bits @@ -366,7 +367,7 @@ lbError: // We twiddle these flags on kmidGalaxiteDelivery and kstPutMiner Assert(m_pstruc->ctx == 3 && m_pstruc->cty == 2); - gsim.GetLevel()->GetTerrainMap()->SetFlags(TcFromWc(m_wx) + 1, + gsim.GetLevel()->GetTerrainMap()->SetFlags(TcFromWc(m_wx), TcFromWc(m_wy) + m_pstruc->cty, 1, 1, kbfStructure); return StructGob::ProcessStateMachineMessage(st, pmsg); @@ -401,8 +402,9 @@ lbError: } } - if (m_wptFakeMiner.wy > m_wy + WcFromTile16ths(15)) { + if (m_wptFakeMiner.wy > m_wy + WcFromTile16ths(19)) { m_wptFakeMiner.wy -= kwcTile16th; + m_wptFakeMiner.wx += kwcTile / 21; MarkRedraw(); } else { SetState(kstProcessorTakeGalaxite); @@ -516,8 +518,9 @@ lbError: } if (m_wptFakeMiner.wy < wptDst.wy) { - m_wptFakeMiner.wy += kwcTile16th; - MarkRedraw(); + m_wptFakeMiner.wy += kwcTile16th; + m_wptFakeMiner.wx -= kwcTile / 21; + MarkRedraw(); } else { SetState(kstIdle); } @@ -555,7 +558,7 @@ lbError: // We don't need to check anything, just clearing it is safe. Assert(m_pstruc->ctx == 3 && m_pstruc->cty == 2); - gsim.GetLevel()->GetTerrainMap()->ClearFlags(TcFromWc(m_wx) + 1, + gsim.GetLevel()->GetTerrainMap()->ClearFlags(TcFromWc(m_wx), TcFromWc(m_wy) + m_pstruc->cty, 1, 1, kbfStructure); int nHandled = StructGob::ProcessStateMachineMessage(st, pmsg);