Redraw info panel added to command switch. Debuging code.
This commit is contained in:
parent
00c536842f
commit
5e1e812888
1 changed files with 38 additions and 2 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue