mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Hot reloading attack code in agent now functional
This commit is contained in:
parent
ddb56bd560
commit
b632dbffdd
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -6819,6 +6819,7 @@ version = "0.1.0"
|
||||
dependencies = [
|
||||
"itertools",
|
||||
"lazy_static",
|
||||
"mimalloc",
|
||||
"rand 0.8.5",
|
||||
"specs",
|
||||
"tracing",
|
||||
|
@ -20,3 +20,6 @@ rand = { version = "0.8", features = ["small_rng"] }
|
||||
tracing = "0.1"
|
||||
itertools = "0.10"
|
||||
lazy_static = "1.4.0"
|
||||
|
||||
[target.'cfg(windows)'.dependencies]
|
||||
mimalloc = "0.1.29"
|
||||
|
@ -41,10 +41,7 @@ use specs::Entity as EcsEntity;
|
||||
use vek::*;
|
||||
|
||||
#[cfg(feature = "use-dyn-lib")]
|
||||
use {
|
||||
crate::LIB,
|
||||
std::ffi::CStr,
|
||||
};
|
||||
use {crate::LIB, std::ffi::CStr};
|
||||
|
||||
impl<'a> AgentData<'a> {
|
||||
////////////////////////////////////////
|
||||
@ -704,14 +701,15 @@ impl<'a> AgentData<'a> {
|
||||
controller: &mut Controller,
|
||||
tgt_data: &TargetData,
|
||||
read_data: &ReadData,
|
||||
#[cfg(not(feature = "use-dyn-lib"))]
|
||||
rng: &mut impl Rng,
|
||||
#[cfg(feature = "use-dyn-lib")]
|
||||
_rng: &mut impl Rng,
|
||||
#[cfg(all(not(feature = "be-dyn-lib"), not(feature = "use-dyn-lib")))] rng: &mut impl Rng,
|
||||
#[cfg(any(feature = "be-dyn-lib", feature = "use-dyn-lib"))] _rng: &mut impl Rng,
|
||||
) {
|
||||
#[cfg(not(feature = "use-dyn-lib"))]
|
||||
{
|
||||
#[cfg(not(feature = "be-dyn-lib"))]
|
||||
self.attack_inner(agent, controller, tgt_data, read_data, rng);
|
||||
#[cfg(feature = "be-dyn-lib")]
|
||||
self.attack_inner(agent, controller, tgt_data, read_data);
|
||||
}
|
||||
#[cfg(feature = "use-dyn-lib")]
|
||||
{
|
||||
@ -743,10 +741,9 @@ impl<'a> AgentData<'a> {
|
||||
controller: &mut Controller,
|
||||
tgt_data: &TargetData,
|
||||
read_data: &ReadData,
|
||||
#[cfg(not(feature = "use-dyn-lib"))]
|
||||
rng: &mut impl Rng,
|
||||
#[cfg(not(feature = "be-dyn-lib"))] rng: &mut impl Rng,
|
||||
) {
|
||||
#[cfg(feature = "use-dyn-lib")]
|
||||
#[cfg(feature = "be-dyn-lib")]
|
||||
let rng = &mut thread_rng();
|
||||
|
||||
let tool_tactic = |tool_kind| match tool_kind {
|
||||
|
@ -1,6 +1,10 @@
|
||||
#[cfg(all(feature = "be-dyn-lib", feature = "use-dyn-lib"))]
|
||||
compile_error!("Can't use both \"be-dyn-lib\" and \"use-dyn-lib\" features at once");
|
||||
|
||||
#[cfg(all(target_os = "windows", feature = "be-dyn-lib"))]
|
||||
#[global_allocator]
|
||||
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
|
||||
|
||||
pub mod action_nodes;
|
||||
pub mod attack;
|
||||
pub mod consts;
|
||||
|
Loading…
Reference in New Issue
Block a user