mirror of
https://github.com/GTA-ASM/SanAndreasUnity
synced 2024-11-15 00:37:09 +00:00
ignore next collision with second enex
This commit is contained in:
parent
66d1709492
commit
a12f8aebc1
1 changed files with 18 additions and 6 deletions
|
@ -98,6 +98,7 @@ namespace SanAndreasUnity.Behaviours
|
|||
public EntranceExitMapObject CurrentCollidingEnex { get; private set; }
|
||||
public Importing.Items.Placements.EntranceExit FirstEnex { get; private set; }
|
||||
public Importing.Items.Placements.EntranceExit SecondEnex { get; private set; }
|
||||
bool m_ignoreNextCollisionWithSecondEnex = false;
|
||||
|
||||
private Coroutine m_findGroundCoroutine;
|
||||
|
||||
|
@ -650,12 +651,22 @@ namespace SanAndreasUnity.Behaviours
|
|||
if (enex.Info == this.SecondEnex)
|
||||
{
|
||||
// we collided with second enex
|
||||
|
||||
if (m_ignoreNextCollisionWithSecondEnex)
|
||||
{
|
||||
// ignore this collision
|
||||
// collision will be processed next time
|
||||
m_ignoreNextCollisionWithSecondEnex = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// teleport back to first enex ; reset first and second enex
|
||||
var tmpEnex = this.FirstEnex;
|
||||
this.FirstEnex = null;
|
||||
this.SecondEnex = null;
|
||||
this.TeleportToEnex(tmpEnex);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var matchingEnexes = Importing.Items.Item.Enexes.Where(e => e.Name == enex.Info.Name && e != enex.Info);
|
||||
|
@ -668,7 +679,8 @@ namespace SanAndreasUnity.Behaviours
|
|||
// remember first and second enex
|
||||
this.FirstEnex = enex.Info;
|
||||
this.SecondEnex = counterPart;
|
||||
// teleport
|
||||
// teleport to second enex
|
||||
m_ignoreNextCollisionWithSecondEnex = true;
|
||||
this.TeleportToEnex(counterPart);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue