ALPHA FIX - Research returns resources if canceled
Ok this was one real bastard to track down, and shows just how poor the xnova system actually is!
Basically this error was caused by the fact that the research page handled the current planet in a diffrent variable, and didnt set it back to the real currentplanet variable till late on in the file, this meant that when you clicked cancel, the topbar was recalled, which called the resource update function ( the standard per hour tick that updates each time you load a page )
However, this was still using the old values of currentplanet as the research page hadnt yet finished running, as such even tho the research page updated the database with the right values, the resource update function overwrote this with the old values instantly.
in an attempt to fix this, i have set the currentplanet values much soon in the code ( as soon as the calculations are done ) which does indeed fix this issue, BUT i have no had time to test if this will cause other issues. so please do test and report back to me.
Anyway. onto the fix
IN FILE: includes/functions/ResearchBuildingPage.php
FIND:
Code:
$InResearch = false;
BELOW ADD:
Code:
$CurrentPlanet = $WorkingPlanet;
and thats it!
As always, contact me or post here for support.
Wannabe
Re: ALPHA FIX - Research returns resources if canceled
Very nice ;)
Haven't fully tested it yet, but it seems to work just fine :D
All those trouble just because of one line to add. xD
I've tried lots of things and took me alot of time, but something like this, adding a line, I
would have never come up with.
Re: ALPHA FIX - Research returns resources if canceled
eh? is this for xnova or rov11? because i think it works fine for rov11, no one reported this ever. but then again i never payed attention to that.
Re: ALPHA FIX - Research returns resources if canceled
he says xnova so that means too yours hero
Re: ALPHA FIX - Research returns resources if canceled
:P *bows to the great jooro*
lol oh well
Re: ALPHA FIX - Research returns resources if canceled
Yeah this was a fix for ro11, its never been reported to me before now either, but the bug was deffinatly there :)
Re: ALPHA FIX - Research returns resources if canceled
no its not the fix for xnova!
Re: ALPHA FIX - Research returns resources if canceled
haha sycrog your dumb RO11 is made from XNova so it is too a fix for XNova
Re: ALPHA FIX - Research returns resources if canceled
:P rov11 is taken from an advanced release of xnova, a friend game me the files, i took them and used them.. shitty part they were all french, most of the people on this section helped translate rov11, which was cool. I believe we covered 99%.
there was a lot of things that people made, thats why i could never remove rov11, i would be an asshole if i did, a lot of people contributed. i gotta keep them all happy :D to be happy.
Re: ALPHA FIX - Research returns resources if canceled
NOO yiu stupid noobs, that is not a fix for Xnova !
But for all who want know the fix, because you american master developer don't know it and don't test their mod before...
here's the inscription fo xnova:
open: includes/functions/ResearchBuildingPage.php
and search:
Code:
switch($TheCommand){
case 'cancel':
if ($ThePlanet['b_tech_id'] == $Techno) {
and place under it:
Code:
$Needed = GetBuildingPrice ($CurrentUser, $CurrentPlanet, $Techno, true, $ForDestroy);
$CurrentPlanet['metal'] += $Needed['metal'];
$CurrentPlanet['crystal'] += $Needed['crystal'];
$CurrentPlanet['deuterium'] += $Needed['deuterium'];
//$WorkingPlanet['metal'] += $costs['metal'];
//$WorkingPlanet['crystal'] += $costs['crystal'];
//$WorkingPlanet['deuterium'] += $costs['deuterium'];
$WorkingPlanet['b_tech_id'] = 0;
$WorkingPlanet["b_tech"] = 0;
$CurrentUser['b_tech_planet'] = 0;
$UpdateData = true;
$InResearch = false;
Re: ALPHA FIX - Research returns resources if canceled
sycrog you can better leave here because you dont know a thing.
if you are so good like you say like we all doub show it then
Re: ALPHA FIX - Research returns resources if canceled
Quote:
Originally Posted by
Sycrog
NOO yiu stupid noobs, that is not a fix for Xnova !
But for all who want know the fix, because you american master developer don't know it and don't test their mod before...
here's the inscription fo xnova:
open: includes/functions/ResearchBuildingPage.php
and search:
Code:
switch($TheCommand){
case 'cancel':
if ($ThePlanet['b_tech_id'] == $Techno) {
and place under it:
Code:
$Needed = GetBuildingPrice ($CurrentUser, $CurrentPlanet, $Techno, true, $ForDestroy);
$CurrentPlanet['metal'] += $Needed['metal'];
$CurrentPlanet['crystal'] += $Needed['crystal'];
$CurrentPlanet['deuterium'] += $Needed['deuterium'];
//$WorkingPlanet['metal'] += $costs['metal'];
//$WorkingPlanet['crystal'] += $costs['crystal'];
//$WorkingPlanet['deuterium'] += $costs['deuterium'];
$WorkingPlanet['b_tech_id'] = 0;
$WorkingPlanet["b_tech"] = 0;
$CurrentUser['b_tech_planet'] = 0;
$UpdateData = true;
$InResearch = false;
So, basically you took my idea, my one line fix.. and made it ALOT more code, to do the exact same thing..
And how exactly is yours a "better" fix, or infact in any way diffrent to mine?
oh and yes.. this is an xnova fix. since ro11 is based on xnova, and this is a core xnova error.
kthnxbye:rolleyes:
Re: ALPHA FIX - Research returns resources if canceled
Re: ALPHA FIX - Research returns resources if canceled
my fix works fine, atleast it works fine on the ro11 release.
yours however should be looked at, if your going to start converting it to use the main variable, you should do all or none, not half half
Re: ALPHA FIX - Research returns resources if canceled
its okay, sycrog can only talk badly bout other fixes yet he dun post his own "working" fixes, not to mention i havnt seen one release from this so called "unbugged - workin" files;
anyway good job on the fix wannabe, it works fine wit my ro11 lol
(PS: we all kno those files dun exist :o)