Skip to content

Commit

Permalink
make object aware of its subclasses
Browse files Browse the repository at this point in the history
Looking through all places in the scripting API where `l_Object.Set()` is called, here is one where we might want to know about the object's breed.

(Normally we would return the result of `ade_set_object_with_breed()`, but the `testLineOfSight_internal()` function has multiple return arguments.)
  • Loading branch information
Goober5000 committed Jan 17, 2025
1 parent 5f2cefd commit 1c21170
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/scripting/api/libs/mission.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2329,7 +2329,7 @@ int testLineOfSight_internal(lua_State* L, bool returnDist_and_Obj) {
bool hasLoS = test_line_of_sight(&from, &to, std::move(excludedObjectIDs), threshold, testForShields, testForHull, dist, &intersecting_obj);
if (returnDist_and_Obj)
return ade_set_args(L, "bfo", hasLoS, *dist, l_Object.Set(object_h(intersecting_obj)));
return ade_set_args(L, "bfo", hasLoS, *dist, ade_object_to_odata(OBJ_INDEX(intersecting_obj)));
else
return ade_set_args(L, "b", hasLoS);
}
Expand Down

0 comments on commit 1c21170

Please sign in to comment.