Skip to content

Commit

Permalink
Version 2.5.6
Browse files Browse the repository at this point in the history
- Fixed crash on startup introduced by version 2.5.5 (issue #1324)
  • Loading branch information
fmoraes74 committed Sep 21, 2023
1 parent 646e521 commit 23d283d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 14 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 2.5.6
## Fixes
- Fixed crash on startup introduced by version 2.5.5 (issue #1324)

# 2.5.5
## New
- Updated for Hearthstone 27.4.0
Expand Down
4 changes: 2 additions & 2 deletions HSTracker.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3946,7 +3946,7 @@
);
LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/downloaded-frameworks/mono/runtimes/osx-x64/native";
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 2.5.5;
MARKETING_VERSION = 2.5.6;
OTHER_CFLAGS = "$(inherited)";
OTHER_CODE_SIGN_FLAGS = "--deep";
OTHER_LDFLAGS = "$(inherited)";
Expand Down Expand Up @@ -3991,7 +3991,7 @@
);
LIBRARY_SEARCH_PATHS = "$(PROJECT_DIR)/downloaded-frameworks/mono/runtimes/osx-x64/native";
MACOSX_DEPLOYMENT_TARGET = 10.14;
MARKETING_VERSION = 2.5.5;
MARKETING_VERSION = 2.5.6;
OTHER_CODE_SIGN_FLAGS = "--deep";
OTHER_LDFLAGS = "$(inherited)";
PRODUCT_BUNDLE_IDENTIFIER = net.hearthsim.hstracker;
Expand Down
2 changes: 1 addition & 1 deletion HSTracker/BobsBuddy/BobsBuddyInvoker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ class BobsBuddyInvoker {
LastAttackingHero = nil

let simulator = SimulatorProxy()
let input = InputProxy(simulator: simulator)
let input = InputProxy()

if game.player.board.any(isUnknownCard) || game.opponent.board.any(isUnknownCard) {
errorState = .unknownCards
Expand Down
13 changes: 3 additions & 10 deletions HSTracker/Mono/InputProxy.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class InputProxy: MonoHandle, MonoClassInitializer {
if InputProxy._class == nil {
InputProxy._class = MonoHelper.loadClass(ns: "BobsBuddy.Simulation", name: "Input")
// methods
InputProxy._constructor = MonoHelper.getMethod(InputProxy._class, ".ctor", 1)
InputProxy._constructor = MonoHelper.getMethod(InputProxy._class, ".ctor", 0)
InputProxy._setHealths = MonoHelper.getMethod(InputProxy._class, "SetHealths", 2)
InputProxy._setTiers = MonoHelper.getMethod(InputProxy._class, "SetTiers", 2)
InputProxy._setTurn = MonoHelper.getMethod(InputProxy._class, "SetTurn", 1)
Expand All @@ -43,22 +43,15 @@ class InputProxy: MonoHandle, MonoClassInitializer {
}
}

init(simulator: SimulatorProxy) {
override init() {
super.init()

let obj = MonoHelper.objectNew(clazz: InputProxy._class!)
set(obj: obj)

let inst = self.get()

let simInst = simulator.get()

let params = UnsafeMutablePointer<UnsafeMutableRawPointer?>.allocate(capacity: 1)
params[0] = UnsafeMutableRawPointer(simInst)

mono_runtime_invoke(InputProxy._constructor, inst, params, nil)

params.deallocate()
mono_runtime_invoke(InputProxy._constructor, inst, nil, nil)
}

required init(obj: UnsafeMutablePointer<MonoObject>?) {
Expand Down
2 changes: 1 addition & 1 deletion HSTracker/Mono/MonoHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ class MonoHelper {
let sim = SimulatorProxy()

if sim.valid() {
let test = InputProxy(simulator: sim)
let test = InputProxy()

test.setHealths(player: 4, opponent: 4)

Expand Down

0 comments on commit 23d283d

Please sign in to comment.