func_door and func_plat fixes and Q3 compatibility
!1083 (merged) was reverted in 11cc28f3, this replaces it. Changes compared to !1083 (merged):
- commit
func_door: simplify DOOR_START_OPEN implementation
(the one that caused #2876 (closed)) is replaced withfunc_door: update DOOR_START_OPEN documentation
which changes only comments. - code style changes including separating bitwise and logical operators with parens (as required by CONTRIBUTING.md).
- dependency on DP
master
is added, because there's probably some Q3 map(s) where doors would no longer be linked indiv0-stable
.
Support custom func_door and func_plat sounds on Q3A maps
This adds FindFileInMapPack(), a very simple version of _MapInfo_FindArenaFile().
Test map: obs3dm7
func_plat: Use Q3 defaults for .dmg .speed and .lip on Q3 maps
func_plat: don't spawn a "start moving" trigger when .targetname is set on Q3 maps
Test map: obs3dm7
func_plat: fix being stuck in the extended position when .targetname is set on Q3 maps
Test map: obs3dm7
func_door: merge door_use() and door_fire()
Unnecessary tiny func is tiny and unnecessary (and suboptimal for perf).
func_door: implement Q3 CRUSHER spawnflag
Testing this requires working around or fixing #2744 (closed)
!1092 (merged) is now included in this branch via git rebase.
Test map: cpmctf2
func_door: implement Q3 team-based door linking using fullspawndata
Testing this requires DarkPlaces master
func_door: reduce indenting in door_blocked()
Technically this is a small logic change, probably for the better.
func_door: fix bug where doors blocked by players never reversed direction
This bug was inherited from Nexuiz. It worked properly in Quake which didn't have this condition, and in Quake 3.
func_door: use Q3 default .dmg of 2 on Q3 maps
func_door: update documentation to reflect default .dmg of 0
IMO 0 is the best default, because if it were > 0 then mappers would have no way to configure a door that doesn't deal any damage when blocked.
The implemented default has been 0 since (at least) Nexuiz 2.5.2 so changing it now would not be ideal for compatibility.
The comment about the default of 2 was inherited from Quake.
func_door: fix .dmg field having no effect
The player's .takedamage == DAMAGE_AIM not DAMAGE_YES
func_door: update DOOR_START_OPEN documentation
func_door: use Q3 default of 2s .wait time on Q3 maps
func_door: fix .angle values of 315 and 135 degrees being inverted
This bug was inherited from Quake and is fixed by updating to the same maths used in Quake 2 and 3.
Test map: the iris doors in the flag bases on https://ws.q3df.org/map/13circle_xt/
func_door: fix erratic behaviour of spawned trigger field
This was most noticeable with door .wait <= 1 but would eventually occur at higher wait values if players hang around in the trigger field.
To make this reliable AND efficient requires checking the state of the door itself, instead of maintaining a separate state in the trigger field entity.
Test map: the iris doors in the flag bases on https://ws.q3df.org/map/13circle_xt/