Skip to content

Commit

Permalink
Fix guard ai allocation not setting ai type
Browse files Browse the repository at this point in the history
  • Loading branch information
neivv committed Nov 8, 2019
1 parent e7af1e7 commit 64c0654
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aise"
version = "2.28.0"
version = "2.28.1"
authors = ["Markus Heikkinen <ittevien@gmail.com>"]

[lib]
Expand Down
3 changes: 3 additions & 0 deletions src/ai.rs
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,9 @@ unsafe fn get_matching_guard_ai(unit: Unit) -> Option<*mut bw::GuardAi> {
None
} else {
let ai = (*array).first_free;
// Free array objects don't have initialized ai_type if the object
// has never been used before.
(*ai).ai_type = 1;
assert!(unit.player() < 8);
let dest = crate::samase::guard_ais().offset(unit.player() as isize);
ListEntry::move_to(ai, &mut (*array).first_free, &mut (*dest).first);
Expand Down

0 comments on commit 64c0654

Please sign in to comment.