Varsuuk
January 6th, 2021, 05:06
[EDIT - ignore title, someone moved posts around - the title refers to a previously posted and solved thread which still exists with same name below... ;)]
The following is from MoreCore:manager_char_mc.lua
function addClassLevel(nodeChar, sClass, sRecord, nLevel)
local nodeSource = resolveRefNode(sRecord);
Debug.console("nodeChar: ", nodeChar);
Debug.console("sClass: ", sClass);
Debug.console("sRecord: ", sRecord);
local nLevel = DB.getValue(nodeChar, "pcclasslevel", "number");
...
Is the code doing what I think it is doing? i.e., if nodeChar.pcclasslevel does not exist, the value "number" is returned (which is a string instead of the number type expected)?
If I read it right (rusty and wasn't ever a pro), it probably should be:
local nLevel = DB.getValue(nodeChar, "pcclasslevel", 0);
The following is from MoreCore:manager_char_mc.lua
function addClassLevel(nodeChar, sClass, sRecord, nLevel)
local nodeSource = resolveRefNode(sRecord);
Debug.console("nodeChar: ", nodeChar);
Debug.console("sClass: ", sClass);
Debug.console("sRecord: ", sRecord);
local nLevel = DB.getValue(nodeChar, "pcclasslevel", "number");
...
Is the code doing what I think it is doing? i.e., if nodeChar.pcclasslevel does not exist, the value "number" is returned (which is a string instead of the number type expected)?
If I read it right (rusty and wasn't ever a pro), it probably should be:
local nLevel = DB.getValue(nodeChar, "pcclasslevel", 0);