Skip to content

Commit 16b4377

Browse files
committed
Update documentation, account for Anvil changes, count start scripts as using a script, and ignore markerless icons
1 parent ccea6df commit 16b4377

File tree

8 files changed

+25
-19
lines changed

8 files changed

+25
-19
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.0.0"
3+
version = "2.0.1"
44
edition = "2021"
55

66
[dependencies]

WARNINGS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ This exterior cell contains a reference that, by its position, should be part of
6666
### Contains broken reference
6767
There is something wrong with this object and it should not be used.
6868

69-
### Contains black square despite having water
69+
### Contains above water black square
7070
Black squares are used to hide things on the minimap (as black blends in with the fog of war's color as well as the there-is-nothing-here-background's color.)
7171
This doesn't work very well in cells with water as those get a water texture for a background instead of the usual black.
72-
Which makes the black squares stand out like a sore thumb.
72+
Which makes the black squares stand out like a sore thumb if placed above the water.
7373

7474
### Contains an unlinked PrisonMarker
7575
This cell contains a `PrisonMarker` that doesn't link to an interior cell. `PrisonMarker`s need to link to interiors containing `stolen_goods` to prevent crashes.

data/bodyparts.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@
225225
{ "id": "TR_m3_Aramius Marolus" }
226226
] },
227227
{ "model": "T_B_Imp_UNI_HairCountessAnvilPC", "rules": [
228-
{ "id": "PC_i2-Anv_CountessAnv" }
228+
{ "id": "PC_i2-Anv_Millona" }
229229
] }
230230
]
231231
}

src/util.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use std::{collections::HashMap, hash::Hash};
2-
use tes3::esp::{Cell, Creature, Npc, ObjectFlags, TES3Object, TravelDestination};
2+
use tes3::esp::{Book, Cell, Creature, Npc, ObjectFlags, TES3Object, TravelDestination};
33

44
pub const CELL_SIZE: f64 = 8192.;
55
const FLAG_NPC_AUTO_CALC: u32 = 0x10;
@@ -159,3 +159,12 @@ pub fn is_autocalc(npc: &Npc) -> bool {
159159
pub fn cannot_sleep(cell: &Cell) -> bool {
160160
return (cell.data.flags & FLAG_CELL_NO_SLEEP) != 0;
161161
}
162+
163+
pub fn is_marker(book: &Book) -> bool {
164+
if let Some(mesh) = &book.mesh {
165+
return mesh.eq_ignore_ascii_case("tr\\tr_note_pin.nif")
166+
|| mesh.eq_ignore_ascii_case("tr\\tr_editormarker_npc.nif")
167+
|| mesh.eq_ignore_ascii_case("editormarker.nif");
168+
}
169+
return false;
170+
}

src/validators/books.rs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,10 @@
11
use super::Context;
2-
use crate::handlers::Handler;
2+
use crate::{handlers::Handler, util::is_marker};
33
use std::{error::Error, fmt};
44
use tes3::esp::{Book, TES3Object};
55

66
pub struct BookValidator {}
77

8-
fn is_marker(book: &Book) -> bool {
9-
if let Some(mesh) = &book.mesh {
10-
return mesh.eq_ignore_ascii_case("tr\\tr_note_pin.nif")
11-
|| mesh.eq_ignore_ascii_case("tr\\tr_editormarker_npc.nif");
12-
}
13-
return false;
14-
}
15-
168
impl Handler<'_> for BookValidator {
179
fn on_record(&mut self, _: &Context, record: &TES3Object, _: &str, _: &String) {
1810
if let TES3Object::Book(book) = record {

src/validators/missing.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use super::Context;
2-
use crate::handlers::Handler;
2+
use crate::{handlers::Handler, util::is_marker};
33
use tes3::esp::TES3Object;
44

55
pub struct FieldValidator {}
@@ -38,9 +38,11 @@ impl Handler<'_> for FieldValidator {
3838
check(typename, id, "name", &r.name);
3939
}
4040
TES3Object::Book(r) => {
41-
check(typename, id, "icon", &r.icon);
42-
check(typename, id, "mesh", &r.mesh);
43-
check(typename, id, "name", &r.name);
41+
if !is_marker(r) {
42+
check(typename, id, "icon", &r.icon);
43+
check(typename, id, "mesh", &r.mesh);
44+
check(typename, id, "name", &r.name);
45+
}
4446
}
4547
TES3Object::Clothing(r) => {
4648
check(typename, id, "icon", &r.icon);

src/validators/orphans.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ impl Handler<'_> for OrphanValidator {
124124
self.remove_script(&r.script);
125125
self.objects.insert(id.to_ascii_lowercase(), typename);
126126
}
127+
TES3Object::StartScript(r) => {
128+
self.remove_script(&r.script);
129+
}
127130
TES3Object::Static(_) => {
128131
self.objects.insert(id.to_ascii_lowercase(), typename);
129132
}

0 commit comments

Comments
 (0)