Skip to content

Commit 372eb7c

Browse files
committed
Fix marker detection to only report AiFollow to places other than 0,0,0
1 parent c44fbc6 commit 372eb7c

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "StandardsValidator"
3-
version = "2.14.0"
3+
version = "2.14.1"
44
edition = "2021"
55

66
[dependencies]

src/validators/scripts.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ pub struct ScriptValidator {
3434
set_khajiit_var: Regex,
3535
position: Regex,
3636
markers: HashMap<String, (String, PositionMarkerType, bool, i32)>,
37+
aifollow: Regex,
3738
needs_marker: Regex,
3839
marker_id: Regex,
3940
}
@@ -136,7 +137,10 @@ impl Handler<'_> for ScriptValidator {
136137
println!("Script {} uses Position instead of PositionCell", script.id);
137138
}
138139
}
139-
if context.mode != Mode::Vanilla && self.needs_marker.is_match(code) {
140+
if context.mode != Mode::Vanilla
141+
&& self.needs_marker.is_match(code)
142+
&& !self.aifollow.is_match(code)
143+
{
140144
if comment.is_empty() {
141145
if let TES3Object::DialogueInfo(info) = record {
142146
println!(
@@ -266,7 +270,10 @@ impl ScriptValidator {
266270
.build()?;
267271
let position = Regex::new(r"^([,\s]*|.*?->[,\s]*)position[,\s]+")?;
268272
let needs_marker = Regex::new(
269-
r#"^([,\s]*|.*?->[,\s]*)((position|aitravel|aiescort|placeitem)(cell)?[,\s])|(aifollow(cell[,\s]+("[^"]+"|[^,\s]+))?[,\s]+("[^"]+"|[^,\s]+)[,\s]+[0-9]+([,\s][0.]+){3,})"#,
273+
r"^([,\s]*|.*?->[,\s]*)(position|aitravel|aiescort|placeitem|aifollow)(cell)?[,\s]",
274+
)?;
275+
let aifollow = Regex::new(
276+
r#"aifollow(cell[,\s]+("[^"]+"|[^,\s]+))?[,\s]+("[^"]+"|[^,\s]+)[,\s]+[0-9]+([,\s]+[0.]+){3,}"#,
270277
)?;
271278
let marker_id_pattern = r"(^|[,\s])((".to_string()
272279
+ &context
@@ -293,6 +300,7 @@ impl ScriptValidator {
293300
set_khajiit_var,
294301
position,
295302
needs_marker,
303+
aifollow,
296304
marker_id,
297305
markers: HashMap::new(),
298306
})

0 commit comments

Comments
 (0)