-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Configurable stack size per ItemType #4854
base: master
Are you sure you want to change the base?
Conversation
@@ -13685,6 +13686,18 @@ int LuaScriptInterface::luaItemTypeGetWorth(lua_State* L) | |||
return 1; | |||
} | |||
|
|||
int LuaScriptInterface::luaItemTypeGetStackSize(lua_State* L) | |||
{ | |||
// itemType:getStackSize() |
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.
Suggestion
itemType:stackSize(value) // set
itemType:stackSize() // get
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.
it's used only in shop system
setting stack size should be done only on startup, your change reguest will affect ItemType that is and should be static
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.
You're right, I hadn't seen that 😲
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.
not a fan of this "revscriptsys" way of getters and setters, make it obvious getAnything, setAnything
anything() is confusing and may result in undefined behaviour if you by any chance pass value or actually pass no value, which could happen, because lua is a dynamic language
Pull Request Prelude
Changes Proposed
Configurable stack size per ItemType.
Configuration is done in items.xml file by using attribue "stacksize"
Example:
note: npc now can sell multiple bp's with stackable items.
Issues addressed:
N/A
How to test:
Set 'stacksize' in any stackable item