mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
add deny_unknown_fields to item related structs
This commit is contained in:
parent
c3942b5f1f
commit
0933499a3d
@ -982,6 +982,7 @@ const SLASHING_ENERGY_FRACTION: f32 = 0.5;
|
||||
const CRUSHING_POISE_FRACTION: f32 = 1.0;
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct Damage {
|
||||
pub source: DamageSource,
|
||||
pub kind: DamageKind,
|
||||
|
@ -141,6 +141,7 @@ impl Auras {
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct AuraBuffConstructor {
|
||||
pub kind: BuffKind,
|
||||
pub strength: f32,
|
||||
|
@ -8,6 +8,7 @@ use std::{convert::TryFrom, ops::Mul};
|
||||
|
||||
/// Specifies what and how much changed current health
|
||||
#[derive(Clone, Copy, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct HealthChange {
|
||||
/// The amount of the health change, negative is damage, positive is healing
|
||||
pub amount: f32,
|
||||
|
@ -99,6 +99,7 @@ impl Friction {
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Serialize, Deserialize, Default)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct Stats {
|
||||
/// Protection is non-linearly transformed (following summation) to a damage
|
||||
/// reduction using (prot / (60 + prot))
|
||||
@ -232,6 +233,7 @@ impl PartialOrd for Protection {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct Armor {
|
||||
pub kind: ArmorKind,
|
||||
pub stats: StatsSource,
|
||||
|
@ -57,6 +57,7 @@ pub enum Utility {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct Lantern {
|
||||
color: Rgb<u32>,
|
||||
strength_thousandths: u32,
|
||||
@ -335,6 +336,7 @@ impl Effects {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub enum ItemKind {
|
||||
/// Something wieldable
|
||||
Tool(Tool),
|
||||
@ -875,7 +877,7 @@ impl assets::Compound for ItemDef {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
#[serde(rename = "ItemDef")]
|
||||
#[serde(rename = "ItemDef", deny_unknown_fields)]
|
||||
struct RawItemDef {
|
||||
legacy_name: String,
|
||||
legacy_description: String,
|
||||
|
@ -236,6 +236,7 @@ impl ModularBase {
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub enum ModularComponent {
|
||||
ToolPrimaryComponent {
|
||||
toolkind: ToolKind,
|
||||
|
@ -12,6 +12,7 @@ pub enum Effect {
|
||||
|
||||
/// A buff that may be applied to an entity
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct BuffEffect {
|
||||
pub kind: comp::BuffKind,
|
||||
pub data: comp::BuffData,
|
||||
|
Loading…
Reference in New Issue
Block a user