[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Enigma-cvs] enigma/src stones_complex.cc,1.47,1.48
From: |
Ralf Westram <address@hidden> |
Subject: |
[Enigma-cvs] enigma/src stones_complex.cc,1.47,1.48 |
Date: |
Mon, 20 Oct 2003 17:06:18 +0000 |
Update of /cvsroot/enigma/enigma/src
In directory subversions:/tmp/cvs-serv21979/src
Modified Files:
stones_complex.cc
Log Message:
- fixed State-deadlock problem of MovableImpulseStone
Index: stones_complex.cc
===================================================================
RCS file: /cvsroot/enigma/enigma/src/stones_complex.cc,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -d -r1.47 -r1.48
*** stones_complex.cc 20 Oct 2003 08:05:46 -0000 1.47
--- stones_complex.cc 20 Oct 2003 17:06:15 -0000 1.48
***************
*** 1357,1361 ****
void
! PuzzleStone::message(const string& msg, const Value &val)
{
if (msg == "scramble") {
--- 1357,1361 ----
void
! PuzzleStone::message(const string& msg, const Value &val)
{
if (msg == "scramble") {
***************
*** 2020,2024 ****
StoneImpulse_Base::change_state(State new_state)
{
- // warning("StoneImpulse_Base changes State %i -> %i", (int)state,
(int)new_state);
if (new_state == state) return;
--- 2020,2023 ----
***************
*** 2146,2150 ****
: StoneImpulse_Base("st-stoneimpulse_movable")
, repulse(false)
! {}
private:
--- 2145,2150 ----
: StoneImpulse_Base("st-stoneimpulse_movable")
, repulse(false)
! {
! }
private:
***************
*** 2156,2164 ****
switch (st) {
case IDLE:
! if (repulse) {
! repulse = false;
! change_state(PULSING);
! }
! else
init_model();
break;
--- 2156,2164 ----
switch (st) {
case IDLE:
! if (repulse) {
! repulse = false;
! change_state(PULSING);
! }
! else
init_model();
break;
***************
*** 2181,2190 ****
if (!maybe_push_stone (sc)) {
incoming = NODIR; // bad, but no real problem!
! change_state(PULSING);
}
}
void on_impulse(const Impulse& impulse) {
if (move_stone(impulse.dir)) {
Actor *hitman = dynamic_cast<Actor*>(impulse.sender);
if (hitman && player::wielded_item_is(hitman,
"it-magicwand")) {
--- 2181,2195 ----
if (!maybe_push_stone (sc)) {
incoming = NODIR; // bad, but no real problem!
! if (state == IDLE)
! change_state(PULSING);
}
}
void on_impulse(const Impulse& impulse) {
+ State oldstate = state;
+
if (move_stone(impulse.dir)) {
+ notify_state(oldstate); // restart anim if it was animated
before move
+
Actor *hitman = dynamic_cast<Actor*>(impulse.sender);
if (hitman && player::wielded_item_is(hitman,
"it-magicwand")) {
***************
*** 2192,2206 ****
}
}
! StoneImpulse_Base::on_impulse(impulse);
}
void on_move() {
! // when moved, animation seems to be restarted
! // and animcb never sets state to IDLE
! // change_state(IDLE);
!
! if (state == CLOSING) {
! repulse = true;
! }
}
--- 2197,2208 ----
}
}
!
! if (state == IDLE)
! change_state(PULSING);
}
void on_move() {
! if (state != PULSING)
! repulse = true; // pulse again
}
***************
*** 2291,2295 ****
OxydStone::OxydStone()
! : PhotoStone("st-oxyd"),
state(CLOSED)
{
--- 2293,2297 ----
OxydStone::OxydStone()
! : PhotoStone("st-oxyd"),
state(CLOSED)
{
***************
*** 2520,2526 ****
}
! void CoinSlot::animcb() {
change_state(ACTIVE);
! init_model();
}
--- 2522,2528 ----
}
! void CoinSlot::animcb() {
change_state(ACTIVE);
! init_model();
}
***************
*** 2855,2859 ****
void
! Turnstile_Pivot_Base::handleActorsAndItems(bool clockwise, Object
*impulse_sender)
{
GridPos pv_pos = get_pos();
--- 2857,2861 ----
void
! Turnstile_Pivot_Base::handleActorsAndItems(bool clockwise, Object
*impulse_sender)
{
GridPos pv_pos = get_pos();
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Enigma-cvs] enigma/src stones_complex.cc,1.47,1.48,
Ralf Westram <address@hidden> <=