krafttomten
Well-Known Member
Greetings dear otlanders!
Changing an items uniqueid in lua is forbidden through luascript.cpp.
Without this ^ restriction it be possible using the following code:
With an unmodified luascript.cpp this returns the error message "Attempt to set protected key 1337" However, the lua code can be made to work by simply commenting out the attached piece of luascript.cpp (i.e. lines 6877-6881)
Now, I am sure that I am not the only one here getting a slight feeling of discomfort when haphazardly removing safety features I do not fully understand. So I wish to know better what damage I might have caused.
Basically, why is uniqueIds protected?
Will the universe now implode due to my negligence?
Input would be much appreciated, spreading knowledge is beneficial for all of us.
Changing an items uniqueid in lua is forbidden through luascript.cpp.
C++:
if (ItemAttributes::isIntAttrType(attribute)) {
if (attribute == ITEM_ATTRIBUTE_UNIQUEID) {
reportErrorFunc(L, "Attempt to set protected key \"uid\"");
pushBoolean(L, false);
return 1;
}
Without this ^ restriction it be possible using the following code:
Lua:
saidItem:setAttribute(ITEM_ATTRIBUTE_UNIQUEID, 1337)
Now, I am sure that I am not the only one here getting a slight feeling of discomfort when haphazardly removing safety features I do not fully understand. So I wish to know better what damage I might have caused.
Basically, why is uniqueIds protected?
Will the universe now implode due to my negligence?
Input would be much appreciated, spreading knowledge is beneficial for all of us.