-
Notifications
You must be signed in to change notification settings - Fork 772
Add identify/identifyidx script commands and identifyall atcommand #2487
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add identify/identifyidx script commands and identifyall atcommand #2487
Conversation
src/map/atcommand.c
Outdated
| for (int i = 0; i < sd->status.inventorySize; i++) { | ||
| if(sd->status.inventory[i].nameid > 0 && sd->status.inventory[i].identify!=1){ | ||
| if (sd->status.inventory[i].nameid > 0 && sd->status.inventory[i].identify != 1) { | ||
| if (identifyall) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
perhaps move this line to before the for-loop? so that it won't need to go through the loop everytime even if we are just using @identify to identify one item.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was wondering that too, but it would duplicate most of the loop code so I wasn't sure if I should
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Emistry it needs to loop even if you use @identify, to know how many item needs to be identified.
That was the old behavior too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is as dastgir said. Can I mark as resolved and leave it as is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for faster code if (identifyall) better move outside of for
this mean for faster code need two for one inside if block and second inside else block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. I'm wondering, would make more sense to make a separate command block instead of using the same block + strcmp?
277b48e to
33b1391
Compare
33b1391 to
44cdf72
Compare
44cdf72 to
3f47e1b
Compare
Signed-off-by: Haru <[email protected]>
Signed-off-by: Haru <[email protected]>
Signed-off-by: Haru <[email protected]>
3f47e1b to
b20054a
Compare
|
@guilherme-gm I force-pushed on your branch a minute after you did (without realizing) - if you had made any changes (or just to restore your gpg signature, if any), please force-push again, otherwise I'll merge this as is |
|
@MishimaHaruna no problem :) you can merge it as is |
Pull Request Prelude
Changes Proposed
This PR implements script commands to identify items, although lots of scripts nowadays kind of fake that behavior by using a combination of
delitem2+getitem2, this leads to wrong behavior when items have more information, like random options (as shown in this forum post, where doing this leads to losing dropped options). New script commands:identify(<Item ID>): Identifies the first unidentified item with ID = "Item ID"identifyidx(<idx>): Identifies item at inventory indexidx.I took the chance to also add
@identifyallatcommand, because it is quite boring to identify item per item when you are testing lots of drops.Issues addressed: