func_tracktrain: if no globalname is defined, and/or relation target is unset, don't attempt to reposition

This commit is contained in:
Marco Cawthorne 2024-03-17 22:56:36 -07:00
parent 9b9988232f
commit c1eb4bcb99
Signed by: eukara
GPG Key ID: CE2032F0A2882A22
1 changed files with 11 additions and 0 deletions

View File

@ -470,6 +470,17 @@ func_tracktrain::Restore(string strKey, string strValue)
void
func_tracktrain::TransitionComplete(void)
{
/* don't mess with this entity if it wasn't carrying over from someplace */
if (!m_strGlobalName) {
return;
}
/* it might have a globalname, but we may not have been carrying over the the next
level yet! */
if (m_vecRelationTarget == g_vec_null) {
return;
}
/* targetting something, which was used as a reference point */
if (HasTriggerTarget() == true) {
path_track targetEnt = GetTrackNodeForward();