LPMuds.net
Lib Discussion => Dead Souls Support => Topic started by: hells on June 05, 2012, 01:36:59 pm
-
By default the room picks up 1.0 for gravity in the private definition of gravity.
private float Gravity = 1.0;
Should be changed to:
private float Gravity = DEFAULT_GRAVITY;
-
Extra changes to fix where GetCarriedMass is called when it should be calling GetCarriedWeight so it can handle gravity correctly.
lib/living.c
Added GetCarriedWeight after GetCarriedMass.
int GetCarriedWeight(){
return (currency::GetCurrencyWeight() + carry::GetCarriedWeight());
}
lib/currency.c
Added GetCurrencyWeight after GetCurrencyMass:
varargs int GetCurrencyWeight(string type){
return GetCurrencyMass(type) * environment(this_player())->GetGravity();
}
lib/race.c
Added GetCarriedWeight dummy to race so things don't blow up in living:
int GetCarriedWeight(){ return 0; }
Also updated GetMobility:
int GetMobility(){
int max = GetMaxCarry();
int encum, mob;
if( GetParalyzed() ){
return 0;
}
if( max < 1 ){
max = 1;
}
encum = (GetCarriedWeight() * 100)/max;
encum -= (encum * this_object()->GetStatLevel("agility"))/200;
mob = 100 - encum;
if( mob > 100 ){
mob = 100;
}
else if( mob < 1 ){
mob = 0;
}
return mob;
}
lib/race.h
Same added header for the GetCarriedWeight function:
int GetCarriedMass();
int GetCarriedWeight();
int GetMaxCarry();
There are a few places in vehicles and mounts that still use Mass rather than weight but I haven't made those changes yet. I will reply to this thread when I get around to it.
Changes as always are public domain, do whatever you like with this post.