HaodongMo / ARC-9

The nineth weapon base for Gmod by Arctic
90 stars 51 forks source link

Localizations in attachments cause them not to load #202

Closed MokaAkashiya85 closed 9 months ago

MokaAkashiya85 commented 1 year ago

If using ARC9's built-in localization to translate anything within an attachment file already, such as folder name, it will always throw up an error that "GetPhrase" was not found - this is simply because the code for translations is loaded after the attachments are.

[arc9-gsr-ae] addons/arc9-gsr-ae/lua/arc9/common/attachments_bulk/csgo_arc9_skins_ak47.lua:15: attempt to call method 'GetPhrase' (a nil value)
  1. unknown - addons/arc9-gsr-ae/lua/arc9/common/attachments_bulk/csgo_arc9_skins_ak47.lua:15
   2. include - [C]:-1
    3. LoadAtts - lua/arc9/shared/sh_atts.lua:131
     4. unknown - lua/arc9/shared/sh_atts.lua:270
      5. include - [C]:-1
       6. unknown - lua/autorun/sh_arc9_autorun.lua:15

One solution would be to have attachments load after the base fundamentals have loaded, including the localization scripts.

In order to get these attachments to load properly currently is to use the arc9_reloadatts command (or its button in the ARC9 menu).

MokaAkashiya85 commented 9 months ago

Issue is fixed.