nil-core 0.7.13

Multiplayer strategy game
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Copyright (C) Call of Nil contributors
// SPDX-License-Identifier: AGPL-3.0-only

use crate::bail_if_cheats_are_not_allowed;
use crate::error::Result;
use crate::market::fee::MarketFee;
use crate::world::World;

pub fn set_market_fee(world: &mut World, fee: MarketFee) -> Result<()> {
  bail_if_cheats_are_not_allowed!(world);
  *world.market_mut().fee_mut() = fee.clamped();
  world.emit_market()?;
  Ok(())
}