… | |
… | |
2061 | void |
2061 | void |
2062 | move_apply (object *trap, object *victim, object *originator) |
2062 | move_apply (object *trap, object *victim, object *originator) |
2063 | { |
2063 | { |
2064 | static int recursion_depth = 0; |
2064 | static int recursion_depth = 0; |
2065 | |
2065 | |
|
|
2066 | trap = trap->head_ (); |
|
|
2067 | |
2066 | /* Only exits affect DMs. */ |
2068 | /* Only exits affect DMs. */ |
2067 | if (victim->flag [FLAG_WIZPASS] && trap->type != EXIT && trap->type != SIGN) |
2069 | if (victim->flag [FLAG_WIZPASS] && trap->type != EXIT && trap->type != SIGN) |
2068 | return; |
2070 | return; |
2069 | |
2071 | |
2070 | /* move_apply() is the most likely candidate for causing unwanted and |
2072 | /* move_apply() is the most likely candidate for causing unwanted and |
2071 | * possibly unlimited recursion. |
2073 | * possibly unlimited recursion. |
2072 | */ |
2074 | */ |
|
|
2075 | |
2073 | /* The following was changed because it was causing perfectly correct |
2076 | /* The following was changed because it was causing perfectly correct |
2074 | * maps to fail. 1) it's not an error to recurse: |
2077 | * maps to fail. 1) it's not an error to recurse: |
2075 | * rune detonates, summoning monster. monster lands on nearby rune. |
2078 | * rune detonates, summoning monster. monster lands on nearby rune. |
2076 | * nearby rune detonates. This sort of recursion is expected and |
2079 | * nearby rune detonates. This sort of recursion is expected and |
2077 | * proper. This code was causing needless crashes. |
2080 | * proper. This code was causing needless crashes. |
… | |
… | |
2082 | "[trap arch %s, name %s; victim arch %s, name %s]\n", &trap->arch->archname, &trap->name, &victim->arch->archname, &victim->name); |
2085 | "[trap arch %s, name %s; victim arch %s, name %s]\n", &trap->arch->archname, &trap->name, &victim->arch->archname, &victim->name); |
2083 | return; |
2086 | return; |
2084 | } |
2087 | } |
2085 | |
2088 | |
2086 | recursion_depth++; |
2089 | recursion_depth++; |
2087 | if (trap->head) |
|
|
2088 | trap = trap->head; |
|
|
2089 | |
2090 | |
2090 | if (!INVOKE_OBJECT (MOVE_TRIGGER, trap, ARG_OBJECT (victim), ARG_OBJECT (originator))) |
2091 | if (!INVOKE_OBJECT (MOVE_TRIGGER, trap, ARG_OBJECT (victim), ARG_OBJECT (originator))) |
2091 | switch (trap->type) |
2092 | switch (trap->type) |
2092 | { |
2093 | { |
2093 | case PLAYERMOVER: |
2094 | case PLAYERMOVER: |
… | |
… | |
2103 | |
2104 | |
2104 | /* Just put in some sanity check. I think there is a bug in the |
2105 | /* Just put in some sanity check. I think there is a bug in the |
2105 | * above with some objects have zero speed, and thus the player |
2106 | * above with some objects have zero speed, and thus the player |
2106 | * getting permanently paralyzed. |
2107 | * getting permanently paralyzed. |
2107 | */ |
2108 | */ |
2108 | if (victim->speed_left < -50.f) |
2109 | victim->speed_left = max (-50.f, victim->speed_left); |
2109 | victim->speed_left = -50.f; |
|
|
2110 | /* LOG(llevDebug, "apply, playermove, player speed_left=%f\n", victim->speed_left); */ |
2110 | /* LOG(llevDebug, "apply, playermove, player speed_left=%f\n", victim->speed_left); */ |
2111 | } |
2111 | } |
2112 | break; |
2112 | break; |
2113 | |
2113 | |
2114 | case SPINNER: |
2114 | case SPINNER: |