From: Katie <ky...@us...> - 2008-08-23 09:44:59
|
Update of /cvsroot/arianne/stendhal/src/games/stendhal/server/actions/move In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv11202/src/games/stendhal/server/actions/move Modified Files: PushAction.java Log Message: stop players from pushing entities with area larger than 4. can change the area number later Index: PushAction.java =================================================================== RCS file: /cvsroot/arianne/stendhal/src/games/stendhal/server/actions/move/PushAction.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** PushAction.java 13 Aug 2008 12:44:58 -0000 1.7 --- PushAction.java 23 Aug 2008 09:45:05 -0000 1.8 *************** *** 101,107 **** } } // the number of pushes is limited per time and the player ! // must be in range return (player.canPush(rpEntity) && player.nextTo(rpEntity)); } --- 101,116 ---- } } + + // players cannot push rp entities with area larger than 4 + /* I (kymara) looked in java api for Rectangle2D and couldn't find how to + * get the value for area so i have done w * h . I guessed at .size() but didn't work + * if this is ok please delete these comments */ + if (rpEntity.getArea().getWidth() * rpEntity.getArea().getHeight() > 4) { + player.sendPrivateText("You're strong, but not that strong!"); + return false; + } // the number of pushes is limited per time and the player ! // must be in range. return (player.canPush(rpEntity) && player.nextTo(rpEntity)); } |