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 EntranceExitMapObject CurrentCollidingEnex { get; private set; }
|
||||||
public Importing.Items.Placements.EntranceExit FirstEnex { get; private set; }
|
public Importing.Items.Placements.EntranceExit FirstEnex { get; private set; }
|
||||||
public Importing.Items.Placements.EntranceExit SecondEnex { get; private set; }
|
public Importing.Items.Placements.EntranceExit SecondEnex { get; private set; }
|
||||||
|
bool m_ignoreNextCollisionWithSecondEnex = false;
|
||||||
|
|
||||||
private Coroutine m_findGroundCoroutine;
|
private Coroutine m_findGroundCoroutine;
|
||||||
|
|
||||||
|
@ -650,11 +651,21 @@ namespace SanAndreasUnity.Behaviours
|
||||||
if (enex.Info == this.SecondEnex)
|
if (enex.Info == this.SecondEnex)
|
||||||
{
|
{
|
||||||
// we collided with second enex
|
// we collided with second enex
|
||||||
// teleport back to first enex ; reset first and second enex
|
|
||||||
var tmpEnex = this.FirstEnex;
|
if (m_ignoreNextCollisionWithSecondEnex)
|
||||||
this.FirstEnex = null;
|
{
|
||||||
this.SecondEnex = null;
|
// ignore this collision
|
||||||
this.TeleportToEnex(tmpEnex);
|
// 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
|
else
|
||||||
{
|
{
|
||||||
|
@ -668,7 +679,8 @@ namespace SanAndreasUnity.Behaviours
|
||||||
// remember first and second enex
|
// remember first and second enex
|
||||||
this.FirstEnex = enex.Info;
|
this.FirstEnex = enex.Info;
|
||||||
this.SecondEnex = counterPart;
|
this.SecondEnex = counterPart;
|
||||||
// teleport
|
// teleport to second enex
|
||||||
|
m_ignoreNextCollisionWithSecondEnex = true;
|
||||||
this.TeleportToEnex(counterPart);
|
this.TeleportToEnex(counterPart);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue