mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 07:03:16 +00:00
try to fix the weird errors that happen / make them more debuggable
This commit is contained in:
parent
e93db76c77
commit
b288cebf02
3 changed files with 10 additions and 5 deletions
|
@ -705,9 +705,9 @@ pub mod raw {
|
|||
av: ret.5,
|
||||
}))
|
||||
}
|
||||
Err(err) => {
|
||||
Err(_) => {
|
||||
lua.pop_last_n(6);
|
||||
Err(err)
|
||||
Ok(None)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
use crate::lua::{LuaGetValue, LuaPutValue, LuaState};
|
||||
use crate::{AbilityComponent, EntityID};
|
||||
use eyre::{Context, OptionExt};
|
||||
use std::backtrace::Backtrace;
|
||||
pub fn serialize_entity(entity: EntityID) -> eyre::Result<Vec<u8>> {
|
||||
let lua = LuaState::current()?;
|
||||
lua.get_global(c"EwextSerialize");
|
||||
entity.put(lua);
|
||||
lua.call(1, 1i32)
|
||||
.wrap_err("Failed to call EwextSerialize")?;
|
||||
lua.call(1, 1i32).wrap_err(format!(
|
||||
"Failed to call EwextSerialize\n{}",
|
||||
Backtrace::force_capture()
|
||||
))?;
|
||||
let res = lua.to_raw_string(-1);
|
||||
lua.pop_last_n(1i32);
|
||||
res
|
||||
|
|
|
@ -282,7 +282,9 @@ function OnProjectileFired(
|
|||
local proj = EntityGetFirstComponentIncludingDisabled(projectile_id, "ProjectileComponent")
|
||||
local life = EntityGetFirstComponentIncludingDisabled(projectile_id, "LifetimeComponent")
|
||||
if proj == nil or ComponentGetValue2(proj, "lifetime") > 4 or ComponentGetValue2(life, "lifetime") > 4 then
|
||||
ewext.sync_projectile(projectile_id, shooter_player_data.peer_id, rng)
|
||||
if EntityGetIsAlive(projectile_id) then
|
||||
ewext.sync_projectile(projectile_id, shooter_player_data.peer_id, rng)
|
||||
end
|
||||
end
|
||||
if shooter_player_data.peer_id ~= ctx.my_id then
|
||||
if proj ~= nil then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue