Skip to content

Commit

Permalink
ScriptUtils: Ignore select newlines in broken scripts
Browse files Browse the repository at this point in the history
This fixes missing black bars in a cutscene in the castle of arx as
well as a bugged tentacle in the Ylside bunker.

Note: Arx Fatalis 1.21 ignores all newlines here, but there is also
one case of an unexpected newline because the command is missing
a parameter.

Fixes: issue #1014
  • Loading branch information
dscharrer committed Jan 13, 2018
1 parent f5de00e commit f5e3dfe
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/script/ScriptUtils.cpp
Expand Up @@ -241,6 +241,10 @@ void Context::skipWhitespace(bool skipNewlines, bool warnNewlines) {
if(esdat[m_pos] == '\n') {
if(warnNewlines) {
ScriptParserWarning << "unexpected newline";
if(isBlockEndSuprressed(*this, "?")) {
// Ignore the newline
continue;
}
}
if(!skipNewlines) {
return;
Expand Down Expand Up @@ -424,6 +428,9 @@ bool contains(const SuppressionsForPos & list, const Context & context, const st

size_t initSuppressions() {

suppressBlockEnd("akbaa_tentacle", 2428, "?"); // unexpected newline (newline inside command)
suppressBlockEnd("akbaa_tentacle", 3420, "?"); // unexpected newline (newline inside command)

suppressBlockEnd("camera_0027", 1140, "}"); // '}' should be commented out!

suppressBlockEnd("black_thing_0002", 1075, "on"); // missing '}' and accept/refuse
Expand All @@ -436,6 +443,9 @@ size_t initSuppressions() {

suppressBlockEnd("goblin_base_0031", 974, "on"); // missing '}'

suppressBlockEnd("human_base_0082", 24110, "?"); // unexpected newline (newline inside command)
suppressBlockEnd("human_base_0082", 24135, "?"); // unexpected newline (newline inside command)

suppressBlockEnd("lever_0028", 402, "}"); // extranous '}'

// TODO(broken-scripts)
Expand All @@ -446,9 +456,7 @@ size_t initSuppressions() {
suppress("akbaa_phase2", 18549, "playanim"); // animation 'grunt' not loaded

suppress("akbaa_tentacle", 2428, "?"); // unexpected newline (newline inside command)
suppress("akbaa_tentacle", 2432, "on"); // unknown command 'on' (bad newline!)
suppress("akbaa_tentacle", 3420, "?"); // unexpected newline (newline inside command)
suppress("akbaa_tentacle", 3424, "on"); // unknown command 'on' (bad newline!)
suppress("akbaa_tentacle", 3747, "dodamage"); // missing target parameter

suppress("axe_2handed", 26, "settwohanded"); // obsolete command
Expand Down Expand Up @@ -590,9 +598,7 @@ size_t initSuppressions() {
suppress("human_base_0079", 303, "inventory add"); // missing object: "graph/obj3d/interactive/items/armor/leggings_leatherac/leggings_leatherac.teo" (should be 'legging_leather_ac'?)

suppress("human_base_0082", 24110, "?"); // unexpected newline (newline inside command)
suppress("human_base_0082", 24114, "on"); // unknown command 'on' (bad linebreak!)
suppress("human_base_0082", 24135, "?"); // unexpected newline (newline inside command)
suppress("human_base_0082", 24141, "hide"); // unknown command 'hide' (bad linebreak!)

suppress("human_base_0085", 426, "loadanim"); // missing animation 'human_noraml_sit_out', should be 'human_normal_sit_out'?

Expand Down

0 comments on commit f5e3dfe

Please sign in to comment.