[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Enigma-cvs] enigma/src items.cc,1.90,1.91
From: |
Ralf Westram <address@hidden> |
Subject: |
[Enigma-cvs] enigma/src items.cc,1.90,1.91 |
Date: |
Thu, 23 Oct 2003 17:40:47 +0000 |
Update of /cvsroot/enigma/enigma/src
In directory subversions:/tmp/cvs-serv20725/src
Modified Files:
items.cc
Log Message:
- Hollow::check_if_level_finished is aware of hollows 'essential' attribute
Index: items.cc
===================================================================
RCS file: /cvsroot/enigma/enigma/src/items.cc,v
retrieving revision 1.90
retrieving revision 1.91
diff -C2 -d -r1.90 -r1.91
*** items.cc 20 Oct 2003 17:03:16 -0000 1.90
--- items.cc 23 Oct 2003 17:40:44 -0000 1.91
***************
*** 488,502 ****
const unsigned MINTIME = 1000;
! unsigned size = instances.size();
! unsigned cnt = 0;
! for (unsigned i=0; i<size; ++i) {
! Hollow *h = static_cast<Hollow*> (instances[i]);
! if (!h->whiteball || SDL_GetTicks() - h->enter_time < MINTIME)
! continue;
! else
! ++cnt;
}
! if (cnt == player::CountActorsOfKind("ac-whiteball-small"))
enigma::FinishLevel();
}
--- 488,511 ----
const unsigned MINTIME = 1000;
! unsigned wcnt = 0; // counts normal hollows with whiteball
! unsigned ess_wcnt = 0; // counts essential hollows with whiteball
! unsigned ess_cnt = 0; // counts all essential hollows
!
! for (Hollow::InstanceList::const_iterator hi = instances.begin();
! hi != instances.end(); ++hi)
! {
! const Hollow& h = **hi;
! bool essential = h.int_attrib("essential") != 0;
!
! if (h.whiteball && (SDL_GetTicks() - h.enter_time) >= MINTIME) {
! if (essential) ess_wcnt++;
! else wcnt++;
! }
!
! if (essential) ess_cnt++;
}
! if (ess_cnt == ess_wcnt &&
! (wcnt+ess_wcnt) == player::CountActorsOfKind("ac-whiteball-small"))
enigma::FinishLevel();
}
***************
*** 1452,1456 ****
if (rewarp) {
// call warp again after some time
! GameTimer.set_alarm(this, 0.4, false);
}
}
--- 1461,1465 ----
if (rewarp) {
// call warp again after some time
! GameTimer.set_alarm(this, 0.4, false);
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Enigma-cvs] enigma/src items.cc,1.90,1.91,
Ralf Westram <address@hidden> <=
- Prev by Date:
[Enigma-cvs] enigma/data/levels index_esprit.txt, 1.21, 1.22 index_enigma2.txt, 1.4, 1.5
- Next by Date:
[Enigma-cvs] enigma/doc/refman Makefile.am,1.2,1.3
- Previous by thread:
[Enigma-cvs] enigma/data/levels index_esprit.txt, 1.21, 1.22 index_enigma2.txt, 1.4, 1.5
- Next by thread:
[Enigma-cvs] enigma/doc/refman Makefile.am,1.2,1.3
- Index(es):