[FIXED] Unusable interface while trying to edit an item in version 1021

View previous topic View next topic Go down

[FIXED] Unusable interface while trying to edit an item in version 1021

Post  arekku on Mon Feb 17, 2014 4:04 pm

Message: ...AddOns\totalRP2_Creation\totalRP2_Creation_Objet.lua line 340:
  bad argument #1 to 'floor' (number expected, got nil)
Debug:
  [C]: floor()
  ...AddOns\totalRP2_Creation\totalRP2_Creation_Objet.lua:340: TRP2_CreateObjetTabCreation()
  ...AddOns\totalRP2_Creation\totalRP2_Creation_Objet.lua:133: TRP2_PanelCreationOnUpdate()
  ...AddOns\totalRP2_Creation\totalRP2_Creation_Objet.lua:123: TRP2_ChargerCreaObjetPanel()
  ...\AddOns\totalRP2_Creation\totalRP2_Creation_Main.lua:117: TRP2_CreationPanel()
  ...\AddOns\totalRP2_Creation\totalRP2_Creation_Main.lua:968:
     ...\AddOns\totalRP2_Creation\totalRP2_Creation_Main.lua:943

I'll look into it later.

arekku

Posts : 14
Join date : 2014-02-17

View user profile

Back to top Go down

Re: [FIXED] Unusable interface while trying to edit an item in version 1021

Post  arekku on Mon Feb 17, 2014 5:08 pm

Changed
objet["Qualite"] = math.floor(TRP2_DefautToNil(tonumber(TRP2_CreationFrameObjetFrameGeneralQualite:GetValue()),1));
to
objet["Qualite"] = math.floor(tonumber(TRP2_CreationFrameObjetFrameGeneralQualite:GetValue()),1);

and it seems to work.

It should not make a difference, TRP2_DefautToNil seems to work properly, have fun Smile

arekku

Posts : 14
Join date : 2014-02-17

View user profile

Back to top Go down

Re: [FIXED] Unusable interface while trying to edit an item in version 1021

Post  Ellypse on Mon Feb 17, 2014 7:37 pm

Thank you for reporting this issue. This error is because of the way I've changed Total RP to make it bulletproof from the corruption from patch 5.4. However, for some reason, I left this mistake. I will correct this quickly and release a fixed version tomorrow.

_________________
Ellypse, Culte de la Rive Noire, FR
Moedra, Kirin Tor, FR
Maison Celwë'Belore, Officer
avatar
Ellypse
Admin

Posts : 215
Join date : 2013-09-26
Age : 26
Location : Paris, France

View user profile http://renaudparize.fr

Back to top Go down

Re: [FIXED] Unusable interface while trying to edit an item in version 1021

Post  Saelora on Mon Feb 17, 2014 7:40 pm

the issue with this is because math.floor expects an integer, which nil is not, off the top of my head, the correct code should be:

Code:
if TRP2_DefautToNil(tonumber(TRP2_CreationFrameObjetFrameGeneralQualite:GetValue()),1) then
   objet["Qualite"] = math.floor(TRP2_DefautToNil(tonumber(TRP2_CreationFrameObjetFrameGeneralQualite:GetValue()),1));
else
objet["Qualite"] = nil;
end

i'll have a proper look tomorrow when i have some more time to check the fix works.

EDIT: or Ellypse could beat me to it, damn you!
avatar
Saelora

Posts : 3
Join date : 2014-02-11
Age : 25
Location : Brighton, England (Argent Dawn, EU)

View user profile

Back to top Go down

Re: [FIXED] Unusable interface while trying to edit an item in version 1021

Post  Ellypse on Mon Feb 17, 2014 7:43 pm

It should be
Code:
objet["Qualite"] = TRP2_DefautToNil(TRP2_GetInt(TRP2_CreationFrameObjetFrameGeneralQualite:GetValue()),1);
TRP2_GetInt is a function I added to Total RP's API with latest update to get an int when a string or a float value is passed, so float values inserted using the sliders are read as int. This function should have been there. I don't know where my mind was.

There is also an issue with the auras bar. I'm working on it right now.


Last edited by Ellypse on Mon Feb 17, 2014 8:10 pm; edited 1 time in total

_________________
Ellypse, Culte de la Rive Noire, FR
Moedra, Kirin Tor, FR
Maison Celwë'Belore, Officer
avatar
Ellypse
Admin

Posts : 215
Join date : 2013-09-26
Age : 26
Location : Paris, France

View user profile http://renaudparize.fr

Back to top Go down

Re: [FIXED] Unusable interface while trying to edit an item in version 1021

Post  Saelora on Mon Feb 17, 2014 7:46 pm

Ah, fair enough, also, looking back at my code i remembered why i should be going to sleep, not bugfixing right now, i can think of atleast two more elagant ways of doing that snippet than i did there.
avatar
Saelora

Posts : 3
Join date : 2014-02-11
Age : 25
Location : Brighton, England (Argent Dawn, EU)

View user profile

Back to top Go down

Re: [FIXED] Unusable interface while trying to edit an item in version 1021

Post  Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum