trigger_changelevel: check if we're inside a trigger_transition under

certain conditions (and only compare the activator...)
This commit is contained in:
Marco Cawthorne 2022-01-03 19:28:22 -08:00
parent df2a385bbd
commit 08e112e128
Signed by: eukara
GPG Key ID: C196CD8BA993248A
2 changed files with 10 additions and 1 deletions

View File

@ -136,6 +136,14 @@ trigger_changelevel::Change(void)
m_activator = find(world, ::classname, "player");
}
if (m_strLandmark) {
for (entity e = world; (e = find(e, ::classname, "trigger_transition"));) {
if (e.targetname == m_strLandmark)
if (IsInside(m_activator, e) == FALSE)
return;
}
}
/* a trigger_transition may share the same targetname, thus we do this */
for (entity e = world; (e = find(e, ::classname, "info_landmark"));) {
info_landmark lm = (info_landmark)e;

View File

@ -181,7 +181,8 @@ NSSurfacePropEntity::SpawnKey(string strKey, string strValue)
{
switch (strKey) {
case "health":
health = stof(strValue);
int h = stoi(strValue);
health = (float)h;
m_oldHealth = health;
break;
case "propdata":