Warrior Wombat
New Member
Couldn't find the bug thread, sorry. Feel free to delete/move accordingly.
There is a bug in the code when you have used up all your negotiations goes but you get disconnected before choosing if you would like to pay diamonds or to cancel (the negotiations).
The error is in the "de.innogames.strategycity.shared.ui.window.negotiationgame.view.NegotiationGameWindowMediator" object, in the "_enforceHistory" method.
What is happening, is that it is going through the history of negotiations and counting every failed attempt in a slot.
Example:
For try #1, it will count the number of "not_needed" and "wrong_person", which is 4 incorrect tries
For try #2, it will count the number of "not_needed" and "wrong_person", which is 4 incorrect tries
For try #3, it will count the number of "not_needed" and "wrong_person", which is 3 incorrect tries
So on the screen, it will show "Only 11 left!". This is wrong, because there is only 3 left (slot #1, #3 & #4).
What it should be doing (I think), is to figure out which ones are correct overall and counting the ones that aren't [correct].
Please note, since you minify the JavaScript code, different variable names would be use in the code base.
Obviously, your developers will have their own way in implementing this change - this is just for a general idea on how to go about it.
There is a bug in the code when you have used up all your negotiations goes but you get disconnected before choosing if you would like to pay diamonds or to cancel (the negotiations).
The error is in the "de.innogames.strategycity.shared.ui.window.negotiationgame.view.NegotiationGameWindowMediator" object, in the "_enforceHistory" method.
What is happening, is that it is going through the history of negotiations and counting every failed attempt in a slot.
Example:
Code:
slot #0 slot #1 slot #2 slot #3 slot #4
try #1 not_needed wrong_person correct not_needed wrong_person
try #2 wrong_person wrong_person - not_needed not_needed
try #3 correct not_needed - wrong_person wrong_person
For try #1, it will count the number of "not_needed" and "wrong_person", which is 4 incorrect tries
For try #2, it will count the number of "not_needed" and "wrong_person", which is 4 incorrect tries
For try #3, it will count the number of "not_needed" and "wrong_person", which is 3 incorrect tries
So on the screen, it will show "Only 11 left!". This is wrong, because there is only 3 left (slot #1, #3 & #4).
What it should be doing (I think), is to figure out which ones are correct overall and counting the ones that aren't [correct].
Please note, since you minify the JavaScript code, different variable names would be use in the code base.
Code:
_enforceHistory: function() {
var correct = [false, false, false, false, false]; // <=================== NEW
for (var b = 0, c = this._negotiationModel.get_history(); b < c.length; ) { // <=================== REPLACEMENT (removed 'a' variable)
for (var d = {}, e = 0, f = c[b++].slots; e < f.length; ) {
var n = f[e];
++e;
if (null != n) {
var r = n.slotId
, u = this._view.getSlot(r);
switch (n.state) {
case "not_needed":
// ++a; // <=================== REMOVE
this._negotiationModel.blockResourceSelection(n.resourceId);
break;
// case "wrong_person": // <=================== REMOVE case statement - not required
// ++a
case "correct" // <=================== NEW
correct[r] = true; // <=================== NEW
break; // <=================== NEW
}
this._negotiationModel.blockResourceSelectionForSlot(r, n.resourceId);
d[r] = !0;
u.updateHistoryResult(n)
}
}
d[0] || this._view.getSlot(0).updateHistoryResult(null);
d[1] || this._view.getSlot(1).updateHistoryResult(null);
d[2] || this._view.getSlot(2).updateHistoryResult(null);
d[3] || this._view.getSlot(3).updateHistoryResult(null);
d[4] || this._view.getSlot(4).updateHistoryResult(null)
}
return correct.filter((a) => !a).length // <=================== REPLACEMENT
},
Obviously, your developers will have their own way in implementing this change - this is just for a general idea on how to go about it.