Skip to content

Commit 88bda1c

Browse files
committed
Fixing UI_update_last_created/give_last_created documentation
1 parent 5ab9c5d commit 88bda1c

File tree

3 files changed

+9
-26
lines changed

3 files changed

+9
-26
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<?php
2-
code_block("UI_give_last_created(object obj)\nobj->give_last_created()");
2+
code_block("bool UI_give_last_created(object obj)\nbool obj->give_last_created()");
33
?>
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
11
<?php
2-
add_box(
3-
array(
4-
"BG SPECIFIC",
5-
inline_code("int UI_update_last_created(int pos[])")
6-
)
7-
);
8-
add_box(
9-
array(
10-
"SI SPECIFIC",
11-
inline_code("object UI_update_last_created(int pos[])")
12-
)
13-
);
2+
code_block("bool UI_update_last_created(int pos[])");
143
?>

seventowers/usecode/intrinsics/update_last_created.dat

+7-13
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,18 @@
99
text("The location can be specified by arrays ranging from 1 to 4 components. The meaning of these components is as follows:");
1010
add_list(
1111
array(
12-
"1 element: the object will be deleted (equivalent to '" . inline_code("remove_item") . "' intrinsic);",
13-
"2 elements: mean a (x, y) location. The object is placed at z = 0 in the current game map;",
14-
"3 elements: mean a (x, y, z) location. The object is placed in the current game map;",
15-
"4 elements: mean a (x, y, z, map) location. The object is placed in the specified map unless it is -1, in which case it will be placed in the current game map.",
12+
"1 element: the object will be deleted (equivalent to '" . inline_code("remove_item") . "' intrinsic). The original usecode generally passed '" . inline_code("-358") . "' for this parameter, but this is likely just by convention as any value works.",
13+
"2 elements: mean a (x, y) location. In Exult, the object is placed at " . inline_code("z = 0") . " in the current game map; in the original games, nothing is done and the update fails.",
14+
"3 elements: mean a (x, y, z) location. The object is placed in the current game map. In Exult, this always succeeds; it could fail in the original games.",
15+
"4 elements: mean a (x, y, z, map) location. Exult-only. The object is placed in the specified map unless it is -1, in which case it will be placed in the current game map.",
1616
), true, 4
1717
);
1818
make_header("Return", 0);
19-
text("Zero if the 'last created' stack is empty and '1' if the object was deleted. Otherwise:");
19+
text("For the 1-element version, $false if the 'last created' stack is empty or $true if the object was deleted. Otherwise, returns $true if object was successfully placed on the map, $false otherwise.");
2020
add_box(
2121
array(
22-
"BG SPECIFIC",
23-
"If successful, returns 1."
24-
)
25-
);
26-
add_box(
27-
array(
28-
"SI SPECIFIC",
29-
"If successful, returns a reference to the object."
22+
"NOTES ABOUT ORIGINAL GAMES",
23+
"In the original games, the function could fail to place the item in the map. In this case, it would try to delete an unrelated on-screen object flagged with the TEMPORARY flag to make room for the updated object and retry. The retry could fail again, in which case the update fails; otherwise, it would succeed. This means that, on occasion, using this function could cause objects to be deleted in the original."
3024
)
3125
);
3226
?>

0 commit comments

Comments
 (0)