ENTITIES/mcl_mobs: Give mobs sunburn at correct light level #175
No reviewers
Labels
No Label
blocker
bug
code quality
confirmed
critical
discussion
high priority
incompatibility
incomplete feature
invalid
low priority
missing feauture
needs testing
packet spam
performance
project
regression
translations
unconfirmed
in review
ready for review
No Milestone
No project
No Assignees
2 Participants
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: Mineclonia/Mineclonia#175
Loading…
Reference in New Issue
No description provided.
Delete Branch "fix-mobs-burning-in-sunlight"
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?
Problem
TRACKING ISSUE: #173
Before this patch, the light level that makes mobs that burn in sunlight
catch fire had been mistakenly specified as minetest.LIGHT_MAX or more.
The correct light level for sunlight is LIGHT_SUN, which is one higher
than minetest.LIGHT_MAX. Since minetest.LIGHT_MAX is the maximum light
value that a node can have and torches emit light at that light level,
mobs that burn in sunlight caught fire inside torch nodes.
Solution
The mob API has been adjusted to use
LIGHT_SUN
(15) instead ofLIGHT_MAX
(14).Details
Before this patch:
In Minetest in the file
src/light.h
,LIGHT_MAX
is defied as 14.LIGHT_SUN
is defined as 15.In Mineclonia in the file
mods/ENTITIES/mcl_mobs/api.lua
, line 1060, the code checks for>= minetest.LIGHT_MAX
.In Mineclonia in the file
mods/ITEMS/mcl_torches/init.lua
, line 2, LIGHT_TORCH is set tominetest.LIGHT_MAX
.With this patch, the code in the file
mods/ENTITIES/mcl_mobs/api.lua
checks for== LIGHT_SUN
, which is defined asminetest.LIGHT_MAX + 1
.Testing Steps
Verify Bug
fc47f0a87e
.Verify Patch
66dd87af25
.To do
8855e2568b
to66dd87af25
WIP: ENTITIES/mcl_mobs: Adjust light level for mobs that burn in sunlightto WIP: ENTITIES/mcl_mobs: Give mobs sunburn at correct light levelWIP: ENTITIES/mcl_mobs: Give mobs sunburn at correct light levelto ENTITIES/mcl_mobs: Give mobs sunburn at correct light levelTesting Steps
Verify Bug
fc47f0a87e
.Verify Patch
66dd87af25
.good fixing <3