Skip to content

Commit

Permalink
Merge pull request scp-fs2open#6106 from Goober5000/checkVisibility_fix
Browse files Browse the repository at this point in the history
fix checkVisibility
  • Loading branch information
Goober5000 committed Apr 18, 2024
2 parents 7acf56f + 0a59c53 commit a18b122
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion code/scripting/api/objs/ship.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1382,7 +1382,12 @@ ADE_FUNC(checkVisibility,
object_h* v1 = nullptr;
object_h* v2 = nullptr;
if (!ade_get_args(L, "o|o", l_Ship.GetPtr(&v1), l_Ship.GetPtr(&v2)))
return ade_set_error(L, "o", "");
return ade_set_error(L, "i", 0);
if (!v1 || !v1->isValid())
return ade_set_error(L, "i", 0);
if (v2 && !v2->isValid())
return ade_set_error(L, "i", 0);

ship* viewer_shipp = nullptr;
ship* viewed_shipp = nullptr;
viewed_shipp = &Ships[v1->objp->instance];
Expand Down

0 comments on commit a18b122

Please sign in to comment.