Sphereserver / Source-X

Ultima Online server emulator
Apache License 2.0
58 stars 47 forks source link

Console warning: t_rock | t_crops | t_meat_raw | t_food #1071

Closed GladieUO closed 6 months ago

GladieUO commented 1 year ago

Hi there is this warning if you try to open .info on the items with these types and if they dont have more1 or more2. image

t_rock, if you dont set more1 on an item with this type, everytime you open .info it shows the warning. Shouldnt code check if more1 exist first, before validating it?

    // IT_TREE
    // ? IT_ROCK
    // ? IT_WATER
    // ? IT_GRASS
    struct    // Natural resources. tend to be statics.
    {
        CResourceIDBase m_ridRes;    // more1 = base resource type. RES_REGIONRESOURCE
    } m_itResource;

t_crops, same warning but if the more2 is not set, which is override value for the TDATA2, also should check if its valid first?

    // IT_CROPS
    // IT_FOLIAGE - the leaves of a tree normally.
    struct
    {
        int32 m_Respawn_Sec;                // more1 = plant respawn time in seconds. (for faster growth plants)
        CResourceIDBase m_ridFruitOverride;    // more2 = Override for TDATA2 = What is the fruit of this plant
    } m_itCrop;

    // IT_FOLIAGE - is not consumed on reap (unless eaten then will regrow invis)
    // IT_CROPS    - is consumed and will regrow invis.
    struct
    {
        CResourceIDBase m_ridReset;    // tdata1= what will it be reset to regrow from ? 0=nothing
        CResourceIDBase m_ridGrow;    // tdata2= what will it grow further into ? 0=fully mature.
        CResourceIDBase m_ridFruit;    // tdata3= what can it be reaped for ? 0=immature can't be reaped
    } m_ttCrops;

t_meat_raw same problem

t_food same problem

  // IT_FRUIT
  // IT_FOOD
  // IT_FOOD_RAW
  // IT_MEAT_RAW
  struct
  {
        CResourceIDBase m_ridCook;    // more1=Cooks into this. (only if raw)
      CREID_TYPE m_MeatType;      // more2= Meat from what type of creature ?
      word m_spell;               // morex=SPELL_TYPE = The magic spell cast on this. ( effect of eating.)
      word m_spelllevel;          // morey=level of the spell. (0-1000)
      byte m_poison_skill;        // morez=0-100 = Is poisoned ?
      byte m_foodval;             // morem=food value to restore
  } m_itFood;
GladieUO commented 1 year ago

It also happenes while @dclick on the normal food that is final product, not dropping from monsters etc... :-/

GladieUO commented 7 months ago

I dont think the fix helped. image image

xwerswoodx commented 7 months ago

it looks like an issue from script file, d_itemprop.scp line 72.

GladieUO commented 7 months ago

same error shows up with .xshow more2 on same item. The thing is, other values even tho they are 0 just show 0 instead of error. It seems like its still expecting someting to be in more2 or more1 even tho there dont need to be anything. 😫 But it is just annoying warning, nothing major. image

image

xwerswoodx commented 7 months ago

Yes because the system changed for these types, and before they were on TDATA's, and now you have to move TDATA values from TDATA to MORE values to fix it. What I mean is; for example mr_nothing is set on TDATA1 before for trees, but now it changed to MORE1 so you need to add MORE1=mr_nothing under @Create trigger to fix this issue, but it can cause issues on already created trees so I don't know why someone made this change, because he didn't update X-Scripts depends on this update, also it wasn't necessary even if it should be added, it should added as override instead of removing tdata1.

xwerswoodx commented 7 months ago

Okay I sent another fix for it to fix warnings even MORE1 on Trees not looking implemented at all, I will take a look for later on, but this update should fix all warnings.

GladieUO commented 6 months ago

solved on dev branch, thank you!