Redraw info panel added to command switch. Debuging code.

This commit is contained in:
johns 2001-02-26 00:32:15 +00:00
parent 00c536842f
commit 5e1e812888

View file

@ -22,6 +22,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "freecraft.h"
#include "video.h"
@ -152,7 +153,7 @@ local void HandleUnitAction(Unit* unit)
if( IsSelected(unit) ) { // update display for new action
UpdateButtonPanel();
MustRedraw|=RedrawButtonPanel;
MustRedraw|=RedrawInfoPanel;
}
}
@ -200,7 +201,7 @@ local void HandleUnitAction(Unit* unit)
if( IsSelected(unit) ) { // update display for new action
UpdateButtonPanel();
MustRedraw|=RedrawButtonPanel;
MustRedraw|=RedrawInfoPanel;
}
}
#endif
@ -365,6 +366,41 @@ global void UnitActions(void)
continue;
}
HandleUnitAction(*table);
#ifdef no_DEBUG
//
// Dump the unit to find the network unsyncron bug.
//
{
static FILE* logf;
Unit* unit;
if( !logf ) {
time_t now;
char buf[256];
sprintf(buf,"log_of_freecraft_%d.log",ThisPlayer->Player);
logf=fopen(buf,"wb");
if( !logf ) {
return;
}
fprintf(logf,";;; Log file generated by FreeCraft Version "
VERSION "\n");
time(&now);
fprintf(logf,";;;\tDate: %s",ctime(&now));
fprintf(logf,";;;\tMap: %s\n\n",TheMap.Description);
}
unit=*table;
fprintf(logf,"%d: ",FrameCounter);
fprintf(logf,"%Zd %s S%d/%d-%d\n",
UnitNumber(unit),unit->Type->Ident,
unit->State,unit->SubAction,
unit->Command.Action);
// SaveUnit(unit,logf);
fflush(NULL);
}
#endif
}
}