mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
fix: block states cause crash for rotatable blocks
This commit is contained in:
parent
c9fb33132f
commit
29ca6e969c
3 changed files with 6 additions and 6 deletions
|
|
@ -170,7 +170,7 @@ glm::vec3 PlayerController::selectedBlockPosition;
|
|||
glm::vec3 PlayerController::selectedPointPosition;
|
||||
glm::ivec3 PlayerController::selectedBlockNormal;
|
||||
int PlayerController::selectedBlockId = -1;
|
||||
int PlayerController::selectedBlockStates = 0;
|
||||
int PlayerController::selectedBlockRotation = 0;
|
||||
|
||||
PlayerController::PlayerController(
|
||||
Level* level,
|
||||
|
|
@ -250,7 +250,7 @@ void PlayerController::update(float delta, bool input, bool pause) {
|
|||
updateInteraction();
|
||||
} else {
|
||||
selectedBlockId = -1;
|
||||
selectedBlockStates = 0;
|
||||
selectedBlockRotation = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -365,7 +365,7 @@ void PlayerController::updateInteraction(){
|
|||
if (vox != nullptr){
|
||||
player->selectedVoxel = *vox;
|
||||
selectedBlockId = vox->id;
|
||||
selectedBlockStates = vox->states;
|
||||
selectedBlockRotation = vox->rotation();
|
||||
selectedBlockPosition = iend;
|
||||
selectedPointPosition = end;
|
||||
selectedBlockNormal = norm;
|
||||
|
|
@ -442,7 +442,7 @@ void PlayerController::updateInteraction(){
|
|||
}
|
||||
} else {
|
||||
selectedBlockId = -1;
|
||||
selectedBlockStates = 0;
|
||||
selectedBlockRotation = 0;
|
||||
}
|
||||
if (rclick) {
|
||||
if (item->rt.funcsset.on_use) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue