Skip to content

Commit

Permalink
fix me forgetting how things work
Browse files Browse the repository at this point in the history
  • Loading branch information
bgkillas committed Jan 17, 2025
1 parent 94bd01b commit afc42ea
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ewext/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ pub unsafe extern "C" fn luaopen_ewext0(lua: *mut lua_State) -> c_int {
ExtState::with_global(|state| {
let entity = lua.to_string(1)?.parse::<isize>()?;
let mut peer = lua.to_string(2)?.parse::<u64>()?;
let mut rng: u64 = lua.to_string(3)?.parse::<i32>()?.try_into()?;
let mut rng: u64 = u32::from_ne_bytes(lua.to_string(3)?.parse::<i32>()?.to_ne_bytes()) as u64;
if rng == 0 {
rng = 1;
}
Expand Down
4 changes: 2 additions & 2 deletions ewext/src/modules/entity_sync/diff_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ impl LocalDiffModel {
let var = entity.add_component::<VariableStorageComponent>()?;
var.set_name("ew_gid_lid".into())?;
var.set_value_string(gid.0.to_string().into())?;
var.set_value_int(lid.0.try_into()?)?;
var.set_value_int(i32::from_ne_bytes(lid.0.to_ne_bytes()))?;

if entity
.try_get_first_component::<BossDragonComponent>(None)?
Expand Down Expand Up @@ -1211,7 +1211,7 @@ impl RemoteDiffModel {
if let Some(gid) = self.lid_to_gid.get(&lid) {
var.set_value_string(gid.0.to_string().into())?;
}
var.set_value_int(lid.0.try_into()?)?;
var.set_value_int(i32::from_ne_bytes(lid.0.to_ne_bytes()))?;

Ok(())
}
Expand Down
2 changes: 1 addition & 1 deletion quant.ew/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -648,4 +648,4 @@ end
function OnPlayerDied(player_entity)
ctx.hook.on_player_died(player_entity)
print("player died")
end
end

0 comments on commit afc42ea

Please sign in to comment.