mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-05-24 17:02:46 -05:00
Previously, Follow Me (and anything else that redirects moves, such as various abilities) was unable to redirect the target of a 'randomNormal' target move, because validTargetLoc() always returned false for a 'randomNormal' type move; this reflects the fact that the client is not allowed to specify the target for such a move, because it is chosen randomly. However, the internal game logic does need to be able to specify a target for 'randomNormal' moves. This commit adds a new parameter to validTargetLoc that specifies whether the proposed target was chosen by the client or by the internal game logic. If the proposed target was chosen by the internal game logic, then the same targeting rules apply as in the case of a "normal" target move. Note that it is necessary to add this new parameter, rather than just making 'randomNormal' behave the same as 'normal', because without the userSelected check, a user could send a crafted choice string to the server specifying a target for a 'randomNormal' move, and the server would respect the choice. This implementation correctly prevents the client from specifying the target of a 'randomNormal' move. |
||
|---|---|---|
| .. | ||
| abilities.js | ||
| aliases.js | ||
| formats-data.js | ||
| formats.js | ||
| items.js | ||
| learnsets.js | ||
| moves.js | ||
| pokedex.js | ||
| scripts.js | ||
| statuses.js | ||
| typechart.js | ||