Difference between revisions of "Talk:RemoveItem"
Jump to navigation
Jump to search
→RemoveItem Bug: code tag apparently not properly formatted, switching to PRE
imported>Nephele (RemoveItem Bug) |
imported>DragoonWraith (→RemoveItem Bug: code tag apparently not properly formatted, switching to PRE) |
||
Line 85: | Line 85: | ||
The bug occurs if there are multiple stacks of the same item in an inventory. For example, if the player inventory contains both 15 legitimate Minotaur Horns and 10 stolen Minotaur Horns, then the command: | The bug occurs if there are multiple stacks of the same item in an inventory. For example, if the player inventory contains both 15 legitimate Minotaur Horns and 10 stolen Minotaur Horns, then the command: | ||
:< | :<pre>Player.RemoveItem MinotaurHorn 20</pre> | ||
will attempt to remove all 20 minotaur horns from just '''one''' of the two stacks. Even if that stack contains less than 20 horns, and even if the other stack contains the other horns necessary to reach 20. Therefore, the player will end up with 15 legitimate horns ''or'' 10 stolen ones... instead of ending up with just 5 horns of one type or another. On the other hand, commands such as GetItemCount (correctly) sum all of the different stacks. So scripts for quests such as "Expelled from the Mages Guild" will check and see that the player has the 20 horns necessary for the quest -- but then won't actually remove all 20 horns. | will attempt to remove all 20 minotaur horns from just '''one''' of the two stacks. Even if that stack contains less than 20 horns, and even if the other stack contains the other horns necessary to reach 20. Therefore, the player will end up with 15 legitimate horns ''or'' 10 stolen ones... instead of ending up with just 5 horns of one type or another. On the other hand, commands such as GetItemCount (correctly) sum all of the different stacks. So scripts for quests such as "Expelled from the Mages Guild" will check and see that the player has the 20 horns necessary for the quest -- but then won't actually remove all 20 horns. |