WeiDUorg / weidu

WeiDU is a program used to develop, distribute and install modifications for games based on the Infinity Engine.
http://www.weidu.org
GNU General Public License v2.0
90 stars 20 forks source link

FJ_CRE_VALIDITY on charbase.cre #245

Open aquadrizzt opened 5 months ago

aquadrizzt commented 5 months ago

Is there a specific reason for

PATCH_IF ~%SOURCE_RES%~ STRING_EQUAL_CASE charbase BEGIN
    valid = 0
  END ELSE BEGIN

in fj_cre_validity? Changelog says it is at least 14 years old, so I assume it has something to do with PST? I haven't encountered any game breaking bugs from messing with CHARBASE.cre in PSTEE. Some weird behaviors, sure, but no crashes.

(At the very least, could it be changed to not fail silently?)

FredrikLindgren commented 2 months ago

Pretty sure that's original by Nythrun. I'm not familiar with the reason.

Are you asking for a PRINT statement about charbase not being valid or something else? Presumably Nythrun felt there was good reason to fail the file and not knowing more about it I'm hesitant to remove the check, but I could certainly add a PRINT.

aquadrizzt commented 2 months ago

I'm sure Nythrun had his reasons at the time; I would honestly be surprised if the original PST didn't crash when messing with CHARBASE. However, I have not seen any such instance of modifications to CHARBASE.cre producing a crash in PSTEE (I've used it to, for example, make TNO a Fighter/Mage/Thief, give him new abilities, and change his initial stats).

I would like to ask if this could be changed from silent fail to normal functionality but with a non-warning console print. The main reason for this is that every creature modification function first runs fj_cre_validity, and thus these functions also all fail silently when used in this manner. Sure, working around this kind of implementation is trivial (CHARBAS.cre has no such restriction and I can just copy it over), but this seems like an incorrect use of a helper function - is fj_cre_validity for identifying whether a file is a valid creature file, or should it also impose guardrails to keep a modder from (potentially) breaking their install?

If you want to keep this restriction, I understand, but in that case I think a print warning is warranted.