Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
minetest_game
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Illuna-Minetest
minetest_game
Commits
1237bc3a
Commit
1237bc3a
authored
10 years ago
by
PilzAdam
Committed by
sfan5
10 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Don't override param2 bits that are not used for rotation in screwdriver
parent
854415fd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mods/screwdriver/init.lua
+8
-6
8 additions, 6 deletions
mods/screwdriver/init.lua
with
8 additions
and
6 deletions
mods/screwdriver/init.lua
+
8
−
6
View file @
1237bc3a
...
...
@@ -37,16 +37,18 @@ local function screwdriver_handler(itemstack, user, pointed_thing, mode)
end
-- Set param2
local
n
=
node
.
param2
local
axisdir
=
math.floor
(
n
/
4
)
local
rotation
=
n
-
axisdir
*
4
local
rotationPart
=
node
.
param2
%
32
-- get first 4 bits
local
preservePart
=
node
.
param2
-
rotationPart
local
axisdir
=
math.floor
(
rotationPart
/
4
)
local
rotation
=
rotationPart
-
axisdir
*
4
if
mode
==
ROTATE_FACE
then
n
=
axisdir
*
4
+
nextrange
(
rotation
,
3
)
rotationPart
=
axisdir
*
4
+
nextrange
(
rotation
,
3
)
elseif
mode
==
ROTATE_AXIS
then
n
=
nextrange
(
axisdir
,
5
)
*
4
rotationPart
=
nextrange
(
axisdir
,
5
)
*
4
end
node
.
param2
=
n
node
.
param2
=
preservePart
+
rotationPart
minetest
.
swap_node
(
pos
,
node
)
if
not
minetest
.
setting_getbool
(
"creative_mode"
)
then
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment