Skip to content

Commit 9706a59

Browse files
author
hamstar0
committed
v2.1.7.1
* Fixed issue with Mod.Call being overly picky with bindings
1 parent b2292d9 commit 9706a59

3 files changed

Lines changed: 14 additions & 7 deletions

File tree

Data/Config.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,11 @@ public bool CanUpdateVersion() {
6363
}
6464

6565
public void UpdateToLatestVersion() {
66-
var new_config = new NihilismConfigData();
67-
var vers_since = this.VersionSinceUpdate != "" ?
66+
var versSince = this.VersionSinceUpdate != "" ?
6867
new Version( this.VersionSinceUpdate ) :
6968
new Version();
7069

71-
if( vers_since < new Version(2, 1, 2, 2) ) {
70+
if( versSince < new Version(2, 1, 2, 2) ) {
7271
if( this.DefaultItemBlacklist.Count == 1 &&
7372
this.DefaultRecipeBlacklist.Count == 1 &&
7473
this.DefaultNpcBlacklist.Count == 1 &&

NihilismMod.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,21 @@ public override void PostAddRecipes() {
9393
////////////////
9494

9595
public override object Call( params object[] args ) {
96-
if( args == null || args.Length == 0 ) { throw new HamstarException( "Undefined call type." ); }
96+
//return ModBoilerplateHelpers.HandleModCall( typeof( BetterPaintAPI ), args );
97+
if( args == null || args.Length == 0 ) { throw new HamstarException( "Undefined call." ); }
9798

9899
string callType = args[0] as string;
99-
if( callType == null ) { throw new HamstarException( "Invalid call type." ); }
100+
if( callType == null ) {
101+
LogHelpers.Alert( "Invalid call binding: " + args[0] );
102+
return null;
103+
}
100104

101105
var methodInfo = typeof( NihilismAPI ).GetMethod( callType );
102-
if( methodInfo == null ) { throw new HamstarException( "Invalid call type " + callType ); }
106+
if( methodInfo == null ) {
107+
LogHelpers.Alert( "Unrecognized call binding " + callType + " with args:\n"
108+
+ string.Join( ",\n ", args.SafeSelect( a => a.GetType().Name + ": " + a == null ? "null" : a.ToString() ) ) );
109+
return null;
110+
}
103111

104112
var newArgs = new object[args.Length - 1];
105113
Array.Copy( args, 1, newArgs, 0, args.Length - 1 );

build.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
author = hamstar
2-
version = 2.1.7
2+
version = 2.1.7.1
33
displayName = Nihilism
44
modReferences = HamstarHelpers@4.2.1
55
buildIgnore = *.csproj, *.user, *.bat, obj\*, bin\*, .vs\*, .git\*

0 commit comments

Comments
 (0)