Website TW-DB.info - English support

Laural

Well-Known Member
I guess I'll just have to live without. :( I am not comfortable with changing the script, as the code confuses :p Maybe the server end will get updated at some point.

I do admire you guys who can 'patch and work around' :)
 

lebareslep

New Member
I guess I'll just have to live without. :( I am not comfortable with changing the script, as the code confuses :p Maybe the server end will get updated at some point.

I do admire you guys who can 'patch and work around' :)
There is no reason to be hesitant to change the code. The worst thing you can do (assuming a modicum of common sense - I can't help you if you throw your pc off your desk) is make the script non-functional. In which case you can remove it and reinstall it, which takes a few clicks.
 

redhat.9

New Member
i got the same deal on fairbanks, but at the site, the calculator doesn't work either, just says json error.
This is a server side problem. I got the console log:

Selection_077.jpg

Edit: The game script it's working rigth now. Not working at the site.
 
Last edited:

xShteff

Well-Known Member
Clothcalc's server side, for some reason, really does not enjoy the Patriot's weapons, Pearl weapons or the three American Army weapons. You can "patch" it by, around line 7850 (if editing in Greasemonkey), changing:

Code:
f += '<input style="display:none" type="text" name="items" value=\'' + JSON.stringify(t).replace(/'/g, "\\'") + "' />";
into
Code:
var itemsJson = JSON.stringify(t).replace(/'/g, "\\'");
var naughtyItemIds = [51530000,51531000,51532000,51539000,51540000,51541000,51550000,51551000,51552000];
for(var j = 0; j < naughtyItemIds.length; j++) {
    itemsJson = itemsJson.replace(',"' + naughtyItemIds[j] + '"', '');
}
f += '<input style="display:none" type="text" name="items" value=\'' + itemsJson + "' />";
Mind you, this does mean the script no longer takes these 9 items into consideration.

I'm really wondering what's happening on the server side though. What spell did Innogames put on these items that make poor Clothcalc go haywire?
I believe this should be fixed now. Try again?