Jump to content

[v35.6] SFO2E library bugs


Recommended Posts

I thought it best to start a new thread since I updated the version of SFO2E I use to SCS 35.6.  And do I have a bag of bugs for you already. 🙂

lib_spl, line 99: Thanks for the force_class flag, but it doesn't work properly.  You do a string comparison of %type% to "class", but type here comes from struct_get, which returns a numerical value.  So this condition always fails.

Thoughts: Do we really need this test?  What's wrong with class abilities having wizard- or priest type?  Maybe I want to use them for specialty wizards/priests...  Perhaps it would be better to give an option to set the spell type and only derive it from the spell file if none is given?

--- a/mih_fr/third_party/sfo2e/lib_spl.tph
+++ b/mih_fr/third_party/sfo2e/lib_spl.tph
@@ -96,7 +96,7 @@ BEGIN
                                LPF struct_get STR_VAR arguments=level RET level=value END
                                LPF struct_get STR_VAR arguments=type RET type=value END
                                PATCH_IF force_class BEGIN
-                                       PATCH_IF "%type%" STR_EQ "innate" BEGIN
+                                       PATCH_IF type = 4 BEGIN
                                                SPRINT type "class"
                                        END ELSE BEGIN
                                                PATCH_WARN "spl_copy warning: you set force_class=1, but this spell is type %type%"

lib_spl, lines 110, 115, 117, 121 and 158: At these points the variable spl has been altered by either the call to return_first_pair (line 58) or return_first_entry (line 60) at the start of the function, and the warning prints no useful information.  Using %ids% for the former four and %spell_resref% for the latter fixes the issue.

Note: I did not check if spl_make has similar issues.

                        OUTER_SET proceed=1
                        ACTION_IF already_present BEGIN
                                ACTION_IF overwrite BEGIN
-                                       LAF warning STR_VAR warning="%spl% is already present; overwriting." END
+                                       LAF warning STR_VAR warning="%ids% is already present; overwriting." END
                                END ELSE
                                ACTION_IF mismatch BEGIN
                                        ACTION_IF overwrite_on_mismatch BEGIN
                                                LAF spl_resolve_ids INT_VAR level force_extended replace_on_mismatch=1 STR_VAR type ids RET spell_resref=resref END
-                                               LAF warning STR_VAR warning="%spl% is already present, but at the wrong level/the wrong type; overwriting." END
+                                               LAF warning STR_VAR warning="%ids% is already present, but at the wrong level/the wrong type; overwriting." END
                                        END ELSE BEGIN
-                                               LAF warning STR_VAR warning="%spl% is already present, although at at the wrong level/the wrong type; aborting spl_copy." END
+                                               LAF warning STR_VAR warning="%ids% is already present, although at at the wrong level/the wrong type; aborting spl_copy." END
                                                OUTER_SET proceed=0
                                        END
                                END ELSE BEGIN
-                                       LAF warning STR_VAR warning="%spl% is already present; aborting spl_copy." END
+                                       LAF warning STR_VAR warning="%ids% is already present; aborting spl_copy." END
                                        OUTER_SET proceed=0
                                END
                        END

@@ -155,7 +155,7 @@ BEGIN
                                        END
                                END ELSE
                                ACTION_IF "%icon_base_name%" STR_CMP "" BEGIN
-                                       WARN "spl_copy WARNING (%spl%): you have specified icon_base_name but have not told sfo where to find the icon"
+                                       WARN "spl_copy WARNING (%spell_resref%): you have specified icon_base_name but have not told sfo where to find the icon"
                                END
                        END ELSE BEGIN
                                OUTER_SPRINT spell_resref ""


lib_struct, line 3594: Again, thanks for the new feature, but it is bugged.  Variable %label% is undefined here and should be %arguments%.

--- a/stratagems/sfo2e/lib_struct.tph
+++ b/stratagems/sfo2e/lib_struct.tph
@@ -3590,7 +3590,7 @@ BEGIN
                        READ_STRREF offset value
                END
                flag BEGIN
-                       n=$"SFO_%strtype%_flags"("%label%")
+                       n=$"SFO_%strtype%_flags"("%arguments%")
                        READ_BYTE offset byte
                        value = (byte BAND (2**n)) >> n
                END
@@ -4187,4 +4187,4 @@ BEGIN
        BUT_ONLY

 

Edited by Angel
Link to comment

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...