mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Command error on trying to spawn a pet for an anchored entity
This commit is contained in:
parent
31f67a97b3
commit
2500fa2b42
@ -1586,6 +1586,17 @@ fn handle_spawn(
|
||||
) => {
|
||||
let uid = uid(server, target, "target")?;
|
||||
let alignment = parse_alignment(uid, &opt_align)?;
|
||||
|
||||
if matches!(alignment, Alignment::Owned(_))
|
||||
&& server
|
||||
.state
|
||||
.ecs()
|
||||
.read_storage::<comp::Anchor>()
|
||||
.contains(target)
|
||||
{
|
||||
return Err("Spawning this pet would create an anchor chain".into());
|
||||
}
|
||||
|
||||
let amount = opt_amount.filter(|x| *x > 0).unwrap_or(1).min(50);
|
||||
|
||||
let ai = opt_ai.unwrap_or(true);
|
||||
|
Loading…
Reference in New Issue
Block a user