Skip to content

Commit

Permalink
Merge pull request #5616 from Goober5000/HomingSubsys_fix
Browse files Browse the repository at this point in the history
some fixes for setting HomingSubsystem in script
  • Loading branch information
TRBlount committed Sep 25, 2023
2 parents 9748de5 + 7b410b2 commit b4f6337
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions code/scripting/api/objs/weapon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,16 +263,17 @@ ADE_VIRTVAR(HomingSubsystem, l_Weapon, "subsystem", "Subsystem that weapon will
{
if(wp->target_sig != newh->sig)
{
wp->homing_object = newh->objp;
weapon_set_tracking_info(OBJ_INDEX(objh->objp), objh->objp->parent, OBJ_INDEX(newh->objp), 1, newh->ss);
}
else
{
wp->homing_subsys = newh->ss;
get_subsystem_pos(&wp->homing_pos, wp->homing_object, wp->homing_subsys);
}
}
else
{
wp->homing_object = &obj_used_list;
wp->homing_pos = vmd_zero_vector;
wp->homing_subsys = NULL;
weapon_set_tracking_info(OBJ_INDEX(objh->objp), objh->objp->parent, -1);
}

// need to update the position for multiplayer.
Expand Down

0 comments on commit b4f6337

Please sign in to comment.