Create path only if the target is a SplinePath

This commit is contained in:
smallmodel 2024-11-11 18:28:56 +01:00
parent 54b9a0c340
commit 9d83d58756
No known key found for this signature in database
GPG key ID: 9F2D623CEDF08512

View file

@ -604,9 +604,11 @@ void SplinePath::CreatePath(Event *ev)
target = Target();
if (target[0]) {
ent = (Entity *)G_FindTarget(NULL, target);
if (ent) {
if (ent && ent->IsSubclassOfSplinePath()) {
next = (SplinePath *)ent;
next->owner = this;
} else if (ent) {
ScriptError("SplinePath::CreatePath: target '%s' for '%s' not found (cannot connect to class '%s')\n", target, targetname.c_str(), ent->getClassname());
} else {
ScriptError("SplinePath::CreatePath: target %s not found\n", target);
}