Author Topic: Issue with not counting extratravels given by mounts with cities module...  (Read 3399 times)

Alchemion

  • Guest
Hi,
Did you encounter this type of issue ? the extratravel set for mounts , ie. 24 free extra travel given by stallion, does not add to daily travel allowance set with the cities module...
At the begining of each day, count travel gives only cities module set allowance...
Any idea why this happens or how to remedy it ?

The code that I guess it's incident in the issue is this:

Code: [Select]
case "count-travels":
global $playermount;
$args['available'] += get_module_setting("allowance");
if ($playermount && isset($playermount['mountid'])) {
$id = $playermount['mountid'];
$extra = get_module_objpref("mounts", $id, "extratravel");
$args['available'] += $extra;
}
$args['used'] += get_module_pref("traveltoday");
break;

++

 
Code: [Select]
case "mountfeatures":
$extra = get_module_objpref("mounts", $args['id'], "extratravel");
$args['features']['Travel']=$extra;
break;

++

Code: [Select]
case "newday":
if ($args['resurrection'] != 'true') {
set_module_pref("traveltoday",0);
}
set_module_pref("paidcost", 0);
break;

++

Code: [Select]
case "charstats":
if ($session['user']['alive']){
//addcharstat("Personal Info");
//addcharstat("Home City", get_module_pref("homecity"));
$args = modulehook("count-travels", array('available'=>0,'used'=>0));
$free = max(0, $args['available'] - $args['used']);
addcharstat("Extra Info");
addcharstat("Free Travel", $free);
}
break;

I thought maybe you modified something to the mounts core files... I don't know...

Any hint?

Thank You.

Nightborn

  • Administrator
  • Sr. Member
  • *****
  • Posts: 320
  • Karma: +20/-0
    • View Profile
    • Shinobilegends
Which cities module do you use? The one I ship with, or the one from DP?

I modified the cities module, but I cannot remember modifying any mount-related things.
It should be fixed, but it won't be easy and it won't be fast. If you want
to help - wonderful. But keep in mind that it will take months of wading
through the ugliest code we have in the tree. If you've got a weak stomach -
stay out. I've been there and it's not a nice place.

   - Al Viro

Alchemion

  • Guest
Hi,
I was using the DP cities module, but now, since you mentioned it, I have installed your supplied modified version.
Yet, the error persisted and that made me search a little more in the modules that interfered with the village stats... I found the template village of amwayr doing the problem...
I don't know why the author added the charstats for counting the remaing travels, since this counting was provided by the cities module...
The light was given by your cities module, that showed the correct remaing travels at the travelpoints nav and made me wonder why...
Thanks for the useful reply.
Emanuel.