Changeset 3d64884 in lost-haven


Ignore:
Timestamp:
Feb 23, 2021, 1:58:57 AM (4 years ago)
Author:
Dmitry Portnoy <dportnoy@…>
Branches:
master
Children:
8e945fc
Parents:
4d8825f
Message:

Fix a bug involving player movement and another involving inventory rendering

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • gamegui/Listable.java

    r4d8825f r3d64884  
    55public interface Listable {
    66
    7   void draw(int paramInt1, int paramInt2, Graphics paramGraphics);
     7  void draw(int x, int y, Graphics g);
    88  int getHeight();
    99  int getWidth();
  • gamegui/ScrollList.java

    r4d8825f r3d64884  
    103103    if (this.lstObjects.size() > 0) {
    104104      e = this.lstObjects.get(0);
    105       listHeight = e.getHeight() * (int)Math.ceil(this.lstObjects.size() / (getWidth() / e.getWidth())) + e.getYOffset();
     105      listHeight = e.getHeight() * (int)Math.ceil(this.lstObjects.size() / (float)(getWidth() / e.getWidth())) + e.getYOffset();
    106106    }
    107107    int numPerRow = 0;
     
    110110    }
    111111    for (int x = 0; x < this.lstObjects.size(); x++) {
    112       ((Listable)this.lstObjects.get(x)).draw(e.getHeight() * x % numPerRow + e.getXOffset(), this.fontHeight + x / numPerRow * e.getHeight() - this.textStart, srcGraphics);
     112      ((Listable)this.lstObjects.get(x)).draw(e.getWidth() * (x % numPerRow) + e.getXOffset(), this.fontHeight + x / numPerRow * e.getHeight() - this.textStart, srcGraphics);
    113113    }
    114114    g.drawImage(source, getX(), getY(), null);
  • main/Creature.java

    r4d8825f r3d64884  
    149149    if (this.lastMoved == 0L) {
    150150      dist = 0.0D;
     151      this.lastMoved = System.currentTimeMillis();
     152    } else if (dist != 0.0D) {
     153      this.lastMoved = System.currentTimeMillis();
    151154    }
    152155    if (this.enemyTarget != null) {
    153156      this.target = this.enemyTarget.loc;
    154157    }
    155     this.lastMoved = System.currentTimeMillis();
    156158    if (Point.dist(this.loc, this.target) <= dist) {
    157159      newLoc = this.target;
Note: See TracChangeset for help on using the changeset viewer.