Payday and Missing Credit
-
TurkeyXIII
- Posts: 1460
- Joined: Thu Dec 06, 2007 3:18 am
- Location: Melbourne, Aus
+4 doesn't help. /doh.gif" style="vertical-align:middle" emoid=":doh:" border="0" alt="doh.gif" />Psychosis wrote:QUOTE (Psychosis @ Oct 3 2008, 12:45 AM) so add on $4to starting money
Just calculate it with eleven players, still missing credits. /wink.gif" style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" />
The Escapist (Justin Emerson) @ Dec 21 2010, 02:33 PM:
The history of open-source Allegiance is paved with the bodies of dead code branches, forum flame wars, and personal vendettas. But a community remains because people still love the game.
why not give the commander the modulus of the division?
*would someone please move this to code bugs and suggestions?*
*would someone please move this to code bugs and suggestions?*
Last edited by Ramaglor on Fri Oct 03, 2008 12:02 am, edited 1 time in total.
Spidey's tactical advice on TS during Tourny game
QUOTE We don't need to save our thingy.[/quote]
QUOTE We don't need to save our thingy.[/quote]
-
Clay_Pigeon
- Posts: 3211
- Joined: Tue Mar 29, 2005 8:00 am
- Location: my pod
change
int delta = m_rgMoney[sideID] / np;
to
int delta = m_rgMoney[sideID] / np +1;
?
Team sizes will occasionally result in a slightly larger payday, but I don't think it's enough to worry about, especially since now we can have slightly smaller paydays.
int delta = m_rgMoney[sideID] / np;
to
int delta = m_rgMoney[sideID] / np +1;
?
Team sizes will occasionally result in a slightly larger payday, but I don't think it's enough to worry about, especially since now we can have slightly smaller paydays.
Last edited by Clay_Pigeon on Fri Oct 03, 2008 10:29 am, edited 1 time in total.

"Therefore I will boast all the more gladly about my weaknesses, so that Christ's power may rest on me." -2 Cor 12:9
"Never know how long I've waited, anticipated your smile pressed against mine." -Running
I think a logical way would be:
1:Split the money like now.
2: Add the Total money received by each players of the team and substract it from the total money that the team should have received
3: give the reminder to the comm
I don't see why we should bother giving extra cash to the teams when it's so easy to give them exactly what they should receive.
I'm actually pretty sure there are probably much easier way what than what I suggested without ending up with wrong results.
1:Split the money like now.
2: Add the Total money received by each players of the team and substract it from the total money that the team should have received
3: give the reminder to the comm
I don't see why we should bother giving extra cash to the teams when it's so easy to give them exactly what they should receive.
I'm actually pretty sure there are probably much easier way what than what I suggested without ending up with wrong results.
IMO this will fix the bug:
Maybe I'm wrong, my C/C++ skills suck. 
Code: Select all
void CFSMission::DoPayday(IsideIGC* pside)
{
SideID sideID = pside->GetObjectID();
int np = GetCountOfPlayers(pside, true);
if (np != 0)
{
// pkk: delta is now double
double ddelta = double(m_rgMoney[sideID]) / double(np);
int delta = int(ddelta);
if (delta > 0.0)
{
BEGIN_PFM_CREATE(g.fm, pfmPayday, S, PAYDAY)
END_PFM_CREATE
pfmPayday->dMoney = Money(delta);
g.fm.SendMessages(CFSSide::FromIGC(pside)->GetGroup(), FM_GUARANTEED, FM_FLUSH);
// pkk: convert double back to int
m_rgMoney[sideID] -= int(ddelta * double(np));
const ShipListIGC * plistShip = pside->GetShips();
for(ShipLinkIGC * plinkShip = plistShip->first(); plinkShip; plinkShip = plinkShip->next())
{
CFSShip * pfsShip = (CFSShip *) plinkShip->data()->GetPrivateData();
if (pfsShip->IsPlayer())
{
CFSPlayer* pfsDonate = pfsShip->GetPlayer()->GetAutoDonate();
if (pfsDonate)
pfsDonate->SetMoney(pfsDonate->GetMoney() + delta);
else
pfsShip->SetMoney(pfsShip->GetMoney() + delta);
}
}
}
}
}
Last edited by pkk on Thu Oct 09, 2008 4:40 pm, edited 1 time in total.
The Escapist (Justin Emerson) @ Dec 21 2010, 02:33 PM:
The history of open-source Allegiance is paved with the bodies of dead code branches, forum flame wars, and personal vendettas. But a community remains because people still love the game.
It won't work. "double z = double(x) / double(y); int zz = int(z);" will give identical results as "int zz = x / y;"
I like vly's idea. Bump the comm's payday by "m_rgMoney[sideID] - delta * np".
Also, if you want a division x / y that always rounds up (for positive x, y), you may consider (x + y - 1) / x.
I like vly's idea. Bump the comm's payday by "m_rgMoney[sideID] - delta * np".
Also, if you want a division x / y that always rounds up (for positive x, y), you may consider (x + y - 1) / x.
Globemaster_III wrote:QUOTE (Globemaster_III @ Jan 11 2018, 11:27 PM) as you know i think very little of cashto, cashto alway a flying low pilot, he alway flying a trainer airplane and he rented




