This commit is contained in:
joris 2013-04-03 11:09:28 +02:00
parent 72e97ebe40
commit f50cc657be
5 changed files with 13 additions and 13 deletions

View file

@ -67,9 +67,9 @@ void AiCheckMagic()
// Check if we can cast this spell. SpellIsAvailable checks for upgrades.
if (unit.Type->CanCastSpell[j] && SpellIsAvailable(player, j)
&& SpellTypeTable[j]->AICast) {
if (AutoCastSpell(unit, *SpellTypeTable[j])) {
return; // cast only one spell per time
}
if (AutoCastSpell(unit, *SpellTypeTable[j])) {
return; // cast only one spell per time
}
}
}
}

View file

@ -528,7 +528,8 @@ int SocketSet::Select(int timeout)
} while (retval == -1 && errno == EINTR);
#endif
for (size_t i = 0; i != this->Sockets.size(); ++i) {
for (size_t i = 0; i != this->Sockets.size(); ++i)
{
this->SocketReady[i] = FD_ISSET(this->Sockets[i], &mask);
}
return retval;

View file

@ -85,7 +85,7 @@ int serialize8(unsigned char *buf, int8_t data)
return sizeof(data);
}
template <int N>
int serialize(unsigned char *buf, const char (&data)[N])
int serialize(unsigned char *buf, const char(&data)[N])
{
if (buf) {
memcpy(buf, data, N);
@ -124,7 +124,7 @@ int deserialize8(const unsigned char *buf, int8_t *data)
return sizeof(*data);
}
template <int N>
int deserialize(const unsigned char *buf, char (&data)[N])
int deserialize(const unsigned char *buf, char(&data)[N])
{
memcpy(data, buf, N);
return N;

View file

@ -257,8 +257,7 @@ public:
/**
** Network Selection Info
*/
struct NetworkSelectionHeader
{
struct NetworkSelectionHeader {
unsigned char Type[MaxNetworkCommands]; /// Command
unsigned NumberSent : 6; /// New Number Selected
unsigned Add : 1; /// Adding to Selection
@ -1188,7 +1187,7 @@ void NetworkRecover()
continue;
}
int secs = (FrameCounter - NetworkLastFrame[Hosts[i].PlyNr]) /
(FRAMES_PER_SECOND * VideoSyncSpeed / 100);
(FRAMES_PER_SECOND * VideoSyncSpeed / 100);
// FIXME: display a menu while we wait
if (secs >= 3 && secs < NetworkTimeout) {
if (FrameCounter % FRAMES_PER_SECOND < (unsigned long)NetworkUpdates) {

View file

@ -723,14 +723,14 @@ void CGraphic::Load(bool grayscale)
break;
}
case 4: {
Uint32* p;
Uint32 *p;
for (int i = 0; i < Height; ++i) {
for (int j = 0; j < Width; ++j) {
p = (Uint32 *)(Surface->pixels) + i * Width + j * bpp;
const Uint32 gray = ((Uint8)((*p) * redGray) >> f->Rshift) +
((Uint8)(*(p + 1) * greenGray) >> f->Gshift) +
((Uint8)(*(p + 2) * blueGray) >> f->Bshift) +
((Uint8)(*(p + 3)) >> f->Ashift);
((Uint8)(*(p + 1) * greenGray) >> f->Gshift) +
((Uint8)(*(p + 2) * blueGray) >> f->Bshift) +
((Uint8)(*(p + 3)) >> f->Ashift);
*p = gray;
}
}