Go to file
Kp c179b2f783 Load robot customizations before use
AlexanderBorisov reported[1] a broken demo that ultimately traced to
incorrect reuse of stale data.  The campaign[2] includes per-level robot
definitions for level 3.  Descent incorrectly accessed Robot_info before
reloading it for the new level, so it used the level 3 data on level 4
robots during a warm start of level 4 for regular play, but used only
the level 4 data for a cold start of level 4 for regular play and for
playback of a demo recorded solely on level 4.  The particular
customizations applied on level 3 caused a level 4 demo recorded with
level 3 robot customizations to use different record lengths than a
level 4 demo recorded with level 4 robot customizations.  Since demos do
not record their record lengths, mismatched record lengths lead to
effectively corrupt demos.  In this case, it manifested as writing 8
anim_angles (per model_num 108, the model incorrectly inherited from
level 3) instead of 1 anim_angles (per model_num 37, used only on cold
starts).  The extra anim_angles were then misinterpreted as a run of 42
ND_EVENT_EOF, because the extra angles were unused and the newdemo code
defines the null byte as EOF (separate from receiving an actual EOF
indicator from the file I/O library).  That run of spurious EOF caused
the demo playback code to refuse to play past the spurious EOF,
resulting in a seemingly broken demo.

As an unfortunate, but unavoidable, consequence, this change modifies
the common path (warm playthrough of every level in the campaign) to
work like the uncommon path (cold start of each level).  Further, the
affected robot triggers a trap in d2x::do_silly_animation[3] when using
the correct model_num, because that polygon model has too few models for
the joints used by the robot.  When using the incorrect level 3 data,
the robot animates without trapping.

[1] https://forum.dxx-rebirth.com/showthread.php?tid=1023
[2] http://www.enspiar.com/dmdb/viewMission.php?id=212
```
sha1sum ENTROPY.HOG ENTROPY.MN2
7bc7a12d00a1ddd3ae92ce90eb67d581ecab004a  ENTROPY.HOG
f2688a634f22b30a02c43d8fa1a049deb5a03f70  ENTROPY.MN2

stat -c '%s %Y %n' ENTROPY.HOG ENTROPY.MN2
2402638 875757712 ENTROPY.HOG
511 875757164 ENTROPY.MN2
```
[3]
```
   799				if (jointnum >= Polygon_models[objp.rtype.pobj_info.model_num].n_models) {
   800					Int3();		// Contact Mike: incompatible data, illegal jointnum, problem in pof file?
   801					continue;
   802				}
```
2017-12-31 21:11:25 +00:00
common Fix compile error for !DXX_HAVE_CXX_BUILTIN_FILE_LINE 2017-12-27 05:39:07 +00:00
contrib Update Gentoo ebuilds 2017-11-25 01:56:51 +00:00
d1x-rebirth Merge branch 'psyke83/rpi' into master 2017-10-26 02:02:50 +00:00
d2x-rebirth Replace useless printf with puts 2017-12-05 05:29:55 +00:00
Documentation Require support for reference qualified methods 2016-12-10 17:51:07 +00:00
similar Load robot customizations before use 2017-12-31 21:11:25 +00:00
.gitattributes Add experimental Windows manifest 2017-08-02 02:49:12 +00:00
.gitignore ignore XCode user data 2014-12-06 22:43:12 -08:00
COPYING.txt corrected typo in COPYING.txt (it's to its) 2014-06-06 13:18:52 +02:00
GPL-3.txt Changed custom D1X license to GPLv3 2014-06-01 19:55:23 +02:00
INSTALL.markdown Restore GOG reference in INSTALL.markdown 2017-11-25 01:56:51 +00:00
SConstruct Whitelist openbsd6 as valid host_platform in SConstruct 2017-12-24 00:28:35 +00:00