parts: RemoveController returns delegate indices

The returned integer array contains p->delegate_index, not p->no.

I don't think this caused any bugs, because the game code rejects
returned indices that are > the delegate array length, and the delegate
index appears to always be -1 when this function is called.
This commit is contained in:
Nunuhara Cabbage
2026-08-16 11:05:43 -07:00
parent e76762d11d
commit 05820dc536
+1 -1
View File
@@ -2157,7 +2157,7 @@ void PE_RemoveController(struct page **erase_number_list, int index)
struct parts *next = TAILQ_NEXT(p, parts_list_entry);
if (p->controller_no == ctrl_no) {
*erase_number_list = array_pushback(*erase_number_list,
(union vm_value){.i = p->no}, AIN_ARRAY_INT, -1);
(union vm_value){.i = p->delegate_index}, AIN_ARRAY_INT, -1);
parts_release(p->no);
}
p = next;