I take it you're on a 64-bit Linux box. The save/load code gets tripped up by ints being 32 bits wide while longs are 64 bits. (on 32-bit Linux and any Windows they're both 32 bits so the bug doesn't manifest)
Here's a quick attempt at a fix that shouldn't break save compatibility for Windows users:
Index: src/title/saveload.cpp
===================================================================
--- src/title/saveload.cpp (revision 337)
+++ src/title/saveload.cpp (working copy)
@@ -233,7 +233,7 @@
if(squad[sq]->squad[pos]!=NULL)
{
- numbytes=fwrite(&squad[sq]->squad[pos]->id,sizeof(long),1,h);
+ numbytes=fwrite(&squad[sq]->squad[pos]->id,sizeof(int),1,h);
}
}
@@ -250,7 +250,7 @@
numbytes=fwrite(&dummy_c,sizeof(char),1,h);
if(activesquad!=NULL)
{
- numbytes=fwrite(&activesquad->id,sizeof(long),1,h);
+ numbytes=fwrite(&activesquad->id,sizeof(int),1,h);
}
//DATES
@@ -526,10 +526,11 @@
squad[sq]->squad[pos]=NULL;
if(dummy_c)
{
- fread(&dummy_l,sizeof(long),1,h);
+ int dummy_i;
+ fread(&dummy_i,sizeof(int),1,h);
for(int pl=0;pl<pool.size();pl++)
{
- if(pool[pl]->id==dummy_l)
+ if(pool[pl]->id==dummy_i)
{
squad[sq]->squad[pos]=pool[pl];
}
@@ -550,10 +551,11 @@
fread(&dummy_c,sizeof(char),1,h);
if(dummy_c)
{
- fread(&dummy_l,sizeof(long),1,h);
+ int dummy_l;
+ fread(&dummy_i,sizeof(int),1,h);
for(int sq=0;sq<squad.size();sq++)
{
- if(squad[sq]->id==dummy_l)
+ if(squad[sq]->id==dummy_i)
{
activesquad=squad[sq];
break;