18 Commits

Author SHA1 Message Date
Aaron Suen
90dbadb5bd Fix thrown item stack settling flicker
When a thrown item settles into a node space and
becomes a visinv node, reuse the existing entity instead
of deleting the old one and creating a new one, if
possible.
2021-07-06 07:14:14 -04:00
Aaron Suen
568a5be648 Prevent falling nodes falling into displaced nodes 2021-06-23 21:00:48 -04:00
Aaron Suen
12f7419d84 Guard against crash on invalid ent state
Somehow an ent can get into a state where
it needs to set velocity but doesn't know what
velocity to set; velocities are transient
phenomena anyway, so just ignore this.
2020-10-04 08:20:05 -04:00
Aaron Suen
2cb09e21dd Buff lux tool radioactivity
Lux tools also glow a bit
2020-06-06 07:36:11 -04:00
Aaron Suen
2625f61fd1 Make light_source ents themselves glow 2020-05-26 19:43:09 -04:00
Aaron Suen
7fd4e3dc16 Don't set sprite props on non-sprite visuals 2020-05-25 09:49:06 -04:00
Aaron Suen
9c9eb4b85a Guard against dummy objects in 5.3+
Some time in the 5.3 dev stream (docs updated at
217f3a42), object refs started being invalidated
immediately on calling obj:remove(), such that
obj:get_pos() starts to return nil instead of the object's
last known position.

This can cause some crashes in NodeCore, where we
assume that our object is still valid (or usable as if it
were still valid) even though we're looping through
handlers and any one of them may have remove()d the
object before other handlers get a chance to fire.

Instead, just watch for unexpected nil returns from
functions we expect would never return nil (e.g.
get_pos or get_properties) and return if we hit one.
We can assume all other calls will be non-nil after that
one, as long as we stay in the same function flow.
2020-05-18 18:36:06 -04:00
Aaron Suen
f2455c28f2 Stop entities falling of the bottom of the map. 2020-03-22 14:06:23 -04:00
Aaron Suen
d27c9cbc86 Mapgen limit API cleanup. 2020-03-22 10:59:06 -04:00
Aaron Suen
f140618e45 Partial ent settling on mapgen lower bound
Trying to make it so that the map lower bound
(via mapgen_limit) is solid to all built-in objects.
Before, entities would fall into this space, remain
until unloaded, and then be destroyed.

Falling nodes appear to work correctly.
Item ents still don't settle.
2020-03-22 10:42:01 -04:00
Aaron Suen
0b2f3fce52 Tweak settling check fix to be more cautious. 2020-03-21 08:22:58 -04:00
Aaron Suen
a37ef544ee Destabilize item ents stuck on edges.
Instead of checking only in the center below an entity,
check a random x/z offset below its bounding box, so
an ent that's stuck on an edge will eventually detect
the blocking node below that edge and settle.
2020-03-20 08:43:08 -04:00
Aaron Suen
266de04987 API for getting objects inside one node. 2020-02-09 10:11:13 -05:00
Aaron Suen
0c39f34ebb Fix falling_node rapid column settling. 2020-01-11 00:34:13 -05:00
Aaron Suen
23e7a789cb Try to make stone chipping recipe less boring.
- Items don't down settle when rising.
- Give stone chips some upward kick.
2020-01-09 22:32:33 -05:00
Aaron Suen
726fd63183 Fix some entity behavior bugs.
- Items shooting upward on ladders.
- Suspected crash on hitting unloaded areas.
2020-01-07 21:20:18 -05:00
Aaron Suen
9916922432 Drop float support, displace lava.
BOLO gameplay that feels too "exploity" with ability
to forcibly transport lava upwards.
2020-01-05 13:26:45 -05:00
Aaron Suen
89020e8340 Major rebuild of item_entity.
This created a ton of dependency inversions, which
necessitated moving a number of API functions up into
higher layers, and restructuring dependency lists for
a number of mods.

BOLO: non-deterministic load errors due to missed
dependencies.
2020-01-05 11:42:22 -05:00