Closed bertsarens closed 10 years ago
A timer on CMD_RELATION_WAR should do the trick.
Yer, few ways to do that... setting all War Decs to expire after a limited time unless extended is one (prolly easier)... or adding the option to expire each individual decl based on a given input (more databases junk to store...?)
Depends what's really wanted.
Add to config.h
#define AUTOENDWARS (52)
Add to cmdtick.c at begining of cmdTickGenRanks
int wa, wnum;
int *rels;
And further down, just after Empire Lookup.. (line 41)
if( ( wnum = dbEmpireRelsList( b, &rels ) ) < 0 )
return -3;
wnum <<= 2;
for( wa = 0 ; wa < wnum ; wa += 4 ) {
if( rels[wa+1] == CMD_RELATION_WAR ) {
if( (rels[wa] + AUTOENDWARS) <= svTickNum ) {
cmdExecDelRelation( b, wa );
}
}
}
free( rels );
And that's it... so easy it surprised me.
cmdExecDelRelation( b, wa );
needs to be
cmdExecDelRelation( b, wa/4 );
My mistake, I go up by 4's in the list... so it needs to go back by that factor to cancel the correct number. (or it tries telling it to cancel relation #4 for second relations etc..)
To over-ride the default required time for declerations...
replace in cmdexe.c
if( rel[0]+52 > svTickNum )
with
if( ( rel[0]+52 > svTickNum ) && ( rel[1] != CMD_RELATION_WAR ) )
Implemented, thanks Necro.
Find a way :)