Skip to content

Commit

Permalink
Don't add fire particles when a dragged entity is in a throw or inval…
Browse files Browse the repository at this point in the history
…id position, fixes #784
  • Loading branch information
Eli2 committed Dec 12, 2015
1 parent 76d1a9f commit 589654e
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
17 changes: 10 additions & 7 deletions src/game/NPC.cpp
Expand Up @@ -77,6 +77,7 @@ ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
#include "game/Player.h"
#include "game/Spells.h"

#include "gui/Cursor.h"
#include "gui/Interface.h"
#include "gui/Speech.h"

Expand Down Expand Up @@ -2923,7 +2924,9 @@ void ManageIgnition(Entity * io) {

return;
}


bool addParticles = !(io == DRAGINTER && CANNOT_PUT_IT_HERE != EntityMoveCursor_Ok);

// Torch Management
Entity * plw = NULL;

Expand All @@ -2935,7 +2938,7 @@ void ManageIgnition(Entity * io) {

io->ignition = 25.f;

if(io->obj && !io->obj->facelist.empty()) {
if(addParticles && io->obj && !io->obj->facelist.empty()) {
createObjFireParticles(io->obj, 4, 1, 1);
}
} else if(io->obj && io->obj->fastaccess.fire >= 0 && io->ignition > 0.f) {
Expand All @@ -2949,14 +2952,14 @@ void ManageIgnition(Entity * io) {
return;
}

Vec3f pos = io->obj->vertexlist3[io->obj->fastaccess.fire].v;

createFireParticles(pos, 2, 2);

if(addParticles) {
Vec3f pos = io->obj->vertexlist3[io->obj->fastaccess.fire].v;
createFireParticles(pos, 2, 2);
}
} else {
io->ignition -= framedelay * 0.01f;

if(io->obj && !io->obj->facelist.empty()) {
if(addParticles && io->obj && !io->obj->facelist.empty()) {
float p = io->ignition * framedelay * 0.001f * io->obj->facelist.size() * 0.001f * 2.f;
int positions = std::min(int(std::ceil(p)), 10);

Expand Down
6 changes: 0 additions & 6 deletions src/gui/Cursor.cpp
Expand Up @@ -61,12 +61,6 @@ extern Vec2s DANAEMouse;
extern float STARTED_ANGLE;
long SPECIAL_DRAGINTER_RENDER=0;

enum EntityMoveCursor {
EntityMoveCursor_Throw = -1,
EntityMoveCursor_Ok = 0,
EntityMoveCursor_Invalid = 1
};

EntityMoveCursor CANNOT_PUT_IT_HERE = EntityMoveCursor_Ok;

static TextureContainer * cursorTargetOn = NULL;
Expand Down
8 changes: 8 additions & 0 deletions src/gui/Cursor.h
Expand Up @@ -25,6 +25,14 @@ class TextureContainer;

extern TextureContainer * cursorMovable;

enum EntityMoveCursor {
EntityMoveCursor_Throw = -1,
EntityMoveCursor_Ok = 0,
EntityMoveCursor_Invalid = 1
};

extern EntityMoveCursor CANNOT_PUT_IT_HERE;

void cursorTexturesInit();

bool Manage3DCursor(Entity * io, bool simulate);
Expand Down

0 comments on commit 589654e

Please sign in to comment.