Skip to content

Commit

Permalink
fmt and changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
shanemadden committed Jan 6, 2024
1 parent ab02c8e commit c7df949
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Unreleased
- Remove `Resolvable` trait, moving its functionality to `MaybeHasId`
- Remove `ObjectWithId` and `ObjectWithMaybeId` enums

### Bugfixes:

- Fix `raw_memory::set_public_segments` and `set_default_public_segment` argument conversion

0.19.0 (2023-12-20)
===================

Expand Down
6 changes: 5 additions & 1 deletion src/raw_memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ pub fn set_active_foreign_segment(username: &JsString, segment_id: Option<u8>) {
///
/// [Screeps documentation](https://docs.screeps.com/api/#RawMemory.setDefaultPublicSegment)
pub fn set_default_public_segment(segment_id: Option<u8>) {
RawMemory::set_default_public_segment(segment_id.map(|f| JsValue::from_f64(f as f64)).unwrap_or(JsValue::null()))
RawMemory::set_default_public_segment(
segment_id
.map(|f| JsValue::from_f64(f as f64))
.unwrap_or(JsValue::NULL),
)
}

/// Sets which of your memory segments are readable to other players as
Expand Down

0 comments on commit c7df949

Please sign in to comment.