Small Bug Fix
All checks were successful
CI / Build (ARM64) (push) Successful in 17m42s
CI / Build (AMD64) (push) Successful in 17m49s
CI / Build (ARMHF) (push) Successful in 11m33s
CI / Test (AMD64, Server) (push) Successful in 2m6s
CI / Build Example Mods (push) Successful in 1m18s
CI / Test (ARM64, Client) (push) Successful in 3m26s
CI / Test (ARM64, Server) (push) Successful in 26s
CI / Test (AMD64, Client) (push) Successful in 5m10s
CI / Test (ARMHF, Client) (push) Successful in 3m40s
CI / Test (ARMHF, Server) (push) Successful in 39s
CI / Release (push) Has been skipped

This commit is contained in:
TheBrokenRail 2024-06-21 01:32:11 -04:00
parent 6a2ecb23ed
commit 7718fe5b12

View File

@ -404,7 +404,7 @@ static int32_t get_color(LevelSource *level_source, int32_t x, int32_t z) {
return biome->color;
}
#define BIOME_BLEND_SIZE 7
static int32_t GrassTile_getColor_injection(__attribute__((unused)) GrassTile *tile, LevelSource *level_source, int32_t x, __attribute__((unused)) int32_t y, int32_t z) {
static int32_t GrassTile_getColor_injection(__attribute__((unused)) GrassTile_getColor_t original, __attribute__((unused)) GrassTile *tile, LevelSource *level_source, int32_t x, __attribute__((unused)) int32_t y, int32_t z) {
int r_sum = 0;
int g_sum = 0;
int b_sum = 0;
@ -428,7 +428,7 @@ static int32_t GrassTile_getColor_injection(__attribute__((unused)) GrassTile *t
static int32_t TallGrass_getColor_injection(TallGrass_getColor_t original, TallGrass *tile, LevelSource *level_source, int32_t x, int32_t y, int32_t z) {
int32_t original_color = original(tile, level_source, x, y, z);
if (original_color == 0x339933) {
return GrassTile_getColor_injection(nullptr, level_source, x, y, z);
return GrassTile_getColor_injection(nullptr, nullptr, level_source, x, y, z);
} else {
return original_color;
}
@ -850,7 +850,7 @@ void init_misc() {
// Change Grass Color
if (feature_has("Add Biome Colors To Grass", server_disabled)) {
patch_vtable(GrassTile_getColor, GrassTile_getColor_injection);
overwrite_calls(GrassTile_getColor, GrassTile_getColor_injection);
overwrite_calls(TallGrass_getColor, TallGrass_getColor_injection);
}