From 0a2740240683d4f0658bba2461103c4398a6a2f7 Mon Sep 17 00:00:00 2001 From: Pure_ Date: Mon, 8 Jun 2015 13:18:18 +0000 Subject: [PATCH] Update MediaWiki page '317 Update item container' --- 317-Update-item-container.mediawiki | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/317-Update-item-container.mediawiki b/317-Update-item-container.mediawiki index 51a0849..c0ba718 100644 --- a/317-Update-item-container.mediawiki +++ b/317-Update-item-container.mediawiki @@ -1,7 +1,7 @@ [[Category Packet]] [[Category Packet 317]] {{packet|name=Update item container|description=Updates items in an interface component.|opcode=53|type=VARIABLE_SHORT|length=N/A|revision=317}} -== Camera oscillate == +== Update item container == === Description === Updates the items in a given interface component. @@ -13,23 +13,21 @@ Updates the items in a given interface component. ! Data type ! Description |- -| U [[Data Types#Standard data types|Short]] +| Unsigned [[Data Types#Standard data types|Short]] | Interface ID. |- -| U [[Data Types#Standard data types|Short]] +| Unsigned [[Data Types#Standard data types|Short]] | Amount of items. |- |} The rest in pseudo-code: -for (i = 0; i < amt_of_items; i++) { - item_amount = read_u_byte(); // Item Amount: U Byte - - if (item_amount == 255) - item_amount = read_int_me_b(); // Item Amount (if entered as 255 previously - to allow bigger amounts than 254): Integer Middle-Endian Big (Inverse middle) - - item_id = read_u_short_le_a(); // Item ID: U Short Little Endian Special A -} - -* Someone please fix the code block's syntax, thank you :-) \ No newline at end of file + for (i = 0; i < amt_of_items; i++) { + item_amount = read_u_byte(); // Item Amount: U Byte + + if (item_amount == 255) + item_amount = read_int_me_b(); // Item Amount (if entered as 255 previously - to allow bigger amounts than 254): Integer Middle-Endian Big (Inverse middle) + + item_id = read_u_short_le_a(); // Item ID: U Short Little Endian Special A + } \ No newline at end of file