function settop(this InvWindow *, InventoryItem *thing)
{
int itemi=0;
while (itemi < this.TopItem) {
if (this.ItemAtIndex[itemi]==thing) {
this.TopItem=itemi;
return;
}
itemi++;
}
}
Tuesday, December 16, 2008
Handy code snippet #378
Babar was just asking on Stickam how you'd set a particular inventory item to be first of your inventory window (not rearranging inv item order, but just scrolling the window to the correct point). And here we are:
Subscribe to:
Post Comments (Atom)
Make that
ReplyDeleteif (this.ItemAtIndex[itemi]==thing) {
and it works even neater ;)
You spotted my deliberate mistake! That one and the other one you didn't spot now fixed. :) I blame blogger's rubbishness at posting code
ReplyDeleteYou should blame that we were running a small competition..to which I lost..
ReplyDelete