@@ -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