Bug #4468

use of var[0x86] in grain_mill.pypnml

Added by yexo about 5 years ago. Updated about 5 years ago.

Status:RejectedStart date:2012-10-30
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

Description

The following code in grain_mill.pypnml uses var[0x86] twice. Despite what the comments say, var[0x86] is industry->location.w, the size along one axis of the industry.

/** After 1900, windmills only appear during map generation. */
switch (FEAT_INDUSTRIES, SELF, ${industry.id}_brick_layouts_only_check_layout, var[0x86]) {
    5: return CB_RESULT_LOCATION_DISALLOW;
    ${industry.id}_check_location;
}

switch (FEAT_INDUSTRIES, SELF, ${industry.id}_brick_layouts_only, extra_callback_info2) {
    IND_CREATION_GENERATION: ${industry.id}_check_location;
    ${industry.id}_brick_layouts_only_check_layout;
}

/** Before 1870, only windmills appear. */
switch (FEAT_INDUSTRIES, SELF, ${industry.id}_windmill_layout_only, var[0x86]) {
    5: ${industry.id}_check_location;
    return CB_RESULT_LOCATION_DISALLOW;
}

History

#1 Updated by andythenorth about 5 years ago

  • Status changed from New to Feedback
  • Assignee set to yexo

andythenorth: Yexo: so this is just wrong var being used, replace with correct var? http://dev.openttdcoop.org/issues/4468
[7:27pm] andythenorth: hmm
[7:27pm] valhallasw joined the chat room.
[7:27pm] andythenorth: I've no idea what those switches are trying to achieve
[7:27pm] andythenorth: reading them in context, their purpose is non-obvious
[7:27pm] frosch123: maybe var18?
[7:28pm] frosch123: oh, that is already below
[7:28pm] frosch123: oh, it checks layout
[7:28pm] frosch123: so, var86 is correct
[7:28pm] KritiK joined the chat room.
[7:28pm] frosch123: i guess yexo overlooked that that switch is inside cb 28
[7:28pm] andythenorth: this shows the chain better http://paste.openttdcoop.org/show/1906/
[7:29pm] frosch123: code looks correct to me
[7:30pm] andythenorth: ta

#2 Updated by andythenorth about 5 years ago

  • Status changed from Feedback to Rejected
  • Assignee deleted (yexo)

Rejecting - duplicate of #3205 - as advised by frosch :)

Also available in: Atom PDF