Merge pull request #815 from Fam0r/master

Make BlockPermissions affect gas blocks better
This commit is contained in:
UnknownShadow200 2021-04-02 14:07:44 +11:00 committed by GitHub
commit ebbff5a35a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -738,6 +738,10 @@ void InputHandler_PlaceBlock(void) {
if (Game_CanPick(old) || !Blocks.CanPlace[block]) return;
/* air-ish blocks can only replace over other air-ish blocks */
if (Blocks.Draw[block] == DRAW_GAS && Blocks.Draw[old] != DRAW_GAS) return;
/* undeletable gas blocks can't be replaced with other blocks */
if (Blocks.Collide[old] == COLLIDE_GAS && !Blocks.CanDelete[old]) return;
if (!CheckIsFree(block)) return;
Game_ChangeBlock(pos.X, pos.Y, pos.Z, block);

View File

@ -296,7 +296,6 @@ static void MPConnection_BeginConnect(void) {
String_InitArray(title, titleBuffer);
/* Default block permissions (in case server supports SetBlockPermissions but doesn't send) */
Blocks.CanPlace[BLOCK_AIR] = false; Blocks.CanDelete[BLOCK_AIR] = false;
Blocks.CanPlace[BLOCK_LAVA] = false; Blocks.CanDelete[BLOCK_LAVA] = false;
Blocks.CanPlace[BLOCK_WATER] = false; Blocks.CanDelete[BLOCK_WATER] = false;
Blocks.CanPlace[BLOCK_STILL_LAVA] = false; Blocks.CanDelete[BLOCK_STILL_LAVA] = false;