Skip to content

Commit

Permalink
Hotfix/start skill script (#90)
Browse files Browse the repository at this point in the history
* Update os.em file so that script parameter is passed as a string by default instead of int.
Updated docs for start_skill_script to be clearer what is being asked for, and reflect changes to os.em
Modified script param check to also check the string length.
  • Loading branch information
sigmantium committed Jun 17, 2019
1 parent 7c62743 commit d8911ac
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
5 changes: 5 additions & 0 deletions docs/docs.polserver.com/pol100/corechanges.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
<datemodified>06-17-2019</datemodified>
</header>
<version name="POL100">
<entry>
<date>06-17-2018</date>
<author>DevGIB:</author>
<change type="Changed">Fixed default for OS::Start_Skill_Script on script_name attribute to be string like required.</change>
</entry>
<entry>
<date>06-17-2018</date>
<author>DevGIB:</author>
Expand Down
4 changes: 2 additions & 2 deletions docs/docs.polserver.com/pol100/osem.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@ const SCRIPTOPT_CAN_ACCESS_OFFLINE_MOBILES := 4;</code></explain>
</function>

<function name="Start_Skill_Script">
<prototype>Start_Skill_Script( chr, attr_name, script_name := 0, param := 0 )</prototype>
<prototype>Start_Skill_Script( chr, attr_name, script_name := "", param := 0 )</prototype>
<parameter name="chr" value="Character to start the script for"/>
<parameter name="attr_name" value="AttributeID to start the script for"/>
<parameter name="attr_name" value="String of AttributeID to start the script for e.g. 'Anatomy'"/>
<parameter name="script_name" value="If given, starts this script instead of the default one" />
<parameter name="param" value="object to pass to the script. Only one param may be passed. (optional)"/>
<explain>starts for given chr and attr_name definied script (overrideable with param script_name)</explain>
Expand Down
2 changes: 2 additions & 0 deletions pol-core/doc/core-changes.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
-- POL100 --
06-17-2018 DevGIB:
Changed: Fixed default for OS::Start_Skill_Script on script_name attribute to be string like required.
06-17-2018 DevGIB:
Added: Support for LowerReagentCost, SpellDamageIncrease, FasterCasting, FasterCastRecovery, DefenceIncrease, DefenceIncreaseCap, LowerManaCost, Hitchance,
Luck, FireResistCap, ColdResistCap, EnergyResistCap, PhysicalResistCap, and PoisonResistCap and their subsequent mods to UObject as dynaprops.
Expand Down
2 changes: 1 addition & 1 deletion pol-core/pol/module/osmod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ BObjectImp* OSExecutorModule::start_skill_script()
const String* script_name;
Core::ScriptDef script;

if ( exec.getStringParam( 2, script_name ) )
if ( exec.getStringParam( 2, script_name ) && (script_name->length() > 0))
{
if ( !script.config_nodie( script_name->value(), exec.prog()->pkg, "scripts/skills/" ) )
{
Expand Down
2 changes: 1 addition & 1 deletion pol-core/support/scripts/os.em
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ Set_Debug( debug );


Start_Script( script_name, param := 0 );
Start_Skill_Script( chr, attr_name, script_name := 0, param := 0 );
Start_Skill_Script( chr, attr_name, script_name := "", param := 0 );
Run_Script_To_Completion( script_name, param := 0 );
Run_Script( script_name, param := 0 );

Expand Down

0 comments on commit d8911ac

Please sign in to comment.