Skip to content

Commit

Permalink
rename to destroy_grid
Browse files Browse the repository at this point in the history
  • Loading branch information
estebanfer committed Oct 8, 2023
1 parent 99c8cb8 commit 2e56a07
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 24 deletions.
8 changes: 4 additions & 4 deletions docs/game_data/spel2.lua

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 12 additions & 12 deletions docs/src/includes/_globals.md
Original file line number Diff line number Diff line change
Expand Up @@ -459,18 +459,6 @@ Change [ENT_TYPE](#ENT_TYPE)'s spawned when [Waddler](#Waddler) dies, by default
Max 255 types.
Use empty table as argument to reset to the game default

### destroy_grid_entity


> Search script examples for [destroy_grid_entity](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=destroy_grid_entity)
#### nil destroy_grid_entity(int uid)

#### nil destroy_grid_entity(float x, float y, [LAYER](#LAYER) layer)

Destroy the grid entity, and its item entities, removing them from the grid without dropping particles or gold.
Will also destroy monsters or items that are standing on a linked activefloor or chain, though excludes [MASK](#MASK).PLAYER to prevent crashes

### drop


Expand Down Expand Up @@ -1216,6 +1204,18 @@ Depending on the image size, this can take a moment, preferably don't create the
Create image from file, cropped to the geometry provided. Returns a tuple containing id, width and height.
Depending on the image size, this can take a moment, preferably don't create them dynamically, rather create all you need in global scope so it will load them as soon as the game starts

### destroy_grid


> Search script examples for [destroy_grid](https://github.com/spelunky-fyi/overlunky/search?l=Lua&q=destroy_grid)
#### nil destroy_grid(int uid)

#### nil destroy_grid(float x, float y, [LAYER](#LAYER) layer)

Destroy the grid entity (by uid or position), and its item entities, removing them from the grid without dropping particles or gold.
Will also destroy monsters or items that are standing on a linked activefloor or chain, though excludes [MASK](#MASK).PLAYER to prevent crashes

### disable_floor_embeds


Expand Down
4 changes: 2 additions & 2 deletions src/game_api/rpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1673,7 +1673,7 @@ void move_grid_entity(int32_t uid, float x, float y, LAYER layer)
}
}

void destroy_grid_entity(int32_t uid)
void destroy_grid(int32_t uid)
{
if (auto entity = get_entity_ptr(uid))
{
Expand All @@ -1682,7 +1682,7 @@ void destroy_grid_entity(int32_t uid)
}
}

void destroy_grid_entity(float x, float y, LAYER layer)
void destroy_grid(float x, float y, LAYER layer)
{
auto state = State::get();
uint8_t actual_layer = enum_to_layer(layer);
Expand Down
4 changes: 2 additions & 2 deletions src/game_api/rpc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ void change_waddler_drop(std::vector<ENT_TYPE> ent_types);
void poison_entity(int32_t entity_uid);
void modify_ankh_health_gain(uint8_t max_health, uint8_t beat_add_health);
void move_grid_entity(int32_t uid, float x, float y, LAYER layer);
void destroy_grid_entity(int32_t uid);
void destroy_grid_entity(float x, float y, LAYER layer);
void destroy_grid(int32_t uid);
void destroy_grid(float x, float y, LAYER layer);
void add_item_to_shop(int32_t item_uid, int32_t shop_owner_uid);
void change_poison_timer(int16_t frames);
void set_adventure_seed(int64_t first, int64_t second);
Expand Down
9 changes: 5 additions & 4 deletions src/game_api/script/lua_vm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -966,11 +966,12 @@ end
lua["move_entity"] = move_entity_abs;
/// Teleport grid entity, the destination should be whole number, this ensures that the collisions will work properly
lua["move_grid_entity"] = move_grid_entity;
/// Destroy the grid entity, and its item entities, removing them from the grid without dropping particles or gold.
auto destroy_grid = sol::overload(
static_cast<void (*)(int32_t uid)>(::destroy_grid),
static_cast<void (*)(float x, float y, LAYER layer)>(::destroy_grid));
/// Destroy the grid entity (by uid or position), and its item entities, removing them from the grid without dropping particles or gold.
/// Will also destroy monsters or items that are standing on a linked activefloor or chain, though excludes MASK.PLAYER to prevent crashes
lua["destroy_grid_entity"] = sol::overload(
static_cast<void (*)(int32_t uid)>(::destroy_grid_entity),
static_cast<void (*)(float x, float y, LAYER layer)>(::destroy_grid_entity));
lua["destroy_grid"] = destroy_grid;
/// Make an ENT_TYPE.FLOOR_DOOR_EXIT go to world `w`, level `l`, theme `t`
lua["set_door_target"] = set_door_target;
/// Short for [set_door_target](#set_door_target).
Expand Down

0 comments on commit 2e56a07

Please sign in to comment.