Sabers don't do full damage in MCL #22
Labels
No Label
bug
compat-mode:mineclone2
compat-mode:minetest_game
crash
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: mrkubax10/industrialtest#22
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When I hit something with an electric saber (it's powered on), only 1 point of damage is dealt to the entity
That's the limitation of Minetest engine itself because you cannot register callback that will be called after hitting entity, only players. Since all electric tools use callbacks to check if they are charged it's not possible to fix it right now.
Someone has been able to do a similar thing by overriding
on_punch
for all living entities. https://forum.minetest.net/viewtopic.php?t=11229This is a hack but maybe it's what we need?
I'm not sure where the issue is considering in UI it shows that damage of the saber is 9, but it still deals only inactive damage
The way how electric tools are implemented is that there are 2 variants registered for each tool: inactive and active. Just before usage in appropriate callback it's determined if tool can switch to active mode (if there is enough power stored) and it's replaced with active variant. Same in opposite way if tool doesn't have enough power it's replaced with inactive variant. That's why electric tools are dependent on callbacks.
Seems like a reasonable solution.
What I'm saying is that, I assume, the saber is already in its "active" variant after breaking a leaf block (GUI shows 9 damage) but it still deals 1