Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
286ab545
Commit
286ab545
authored
Apr 30, 2022
by
Melledy
Browse files
Monsters should not drop items inside dungeons
parent
7e377dff
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/game/world/Scene.java
View file @
286ab545
...
...
@@ -375,8 +375,8 @@ public class Scene {
this
.
broadcastPacket
(
new
PacketLifeStateChangeNotify
(
attackerId
,
target
,
LifeState
.
LIFE_DEAD
));
// Reward drop
if
(
target
instanceof
EntityMonster
)
{
Grasscutter
.
getGame
Server
().
getDropManager
().
callDrop
((
EntityMonster
)
target
);
if
(
target
instanceof
EntityMonster
&&
this
.
getSceneType
()
!=
SceneType
.
SCENE_WORLD
)
{
getWorld
().
get
Server
().
getDropManager
().
callDrop
((
EntityMonster
)
target
);
}
this
.
removeEntity
(
target
);
...
...
src/main/java/emu/grasscutter/game/world/World.java
View file @
286ab545
...
...
@@ -27,6 +27,7 @@ import emu.grasscutter.net.proto.AttackResultOuterClass.AttackResult;
import
emu.grasscutter.net.proto.EnterTypeOuterClass.EnterType
;
import
emu.grasscutter.net.proto.VisionTypeOuterClass.VisionType
;
import
emu.grasscutter.scripts.data.SceneConfig
;
import
emu.grasscutter.server.game.GameServer
;
import
emu.grasscutter.server.packet.send.PacketDelTeamEntityNotify
;
import
emu.grasscutter.server.packet.send.PacketEntityFightPropUpdateNotify
;
import
emu.grasscutter.server.packet.send.PacketLifeStateChangeNotify
;
...
...
@@ -44,6 +45,7 @@ import it.unimi.dsi.fastutil.ints.Int2ObjectMaps;
import
it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap
;
public
class
World
implements
Iterable
<
Player
>
{
private
final
GameServer
server
;
private
final
Player
owner
;
private
final
List
<
Player
>
players
;
private
final
Int2ObjectMap
<
Scene
>
scenes
;
...
...
@@ -61,6 +63,7 @@ public class World implements Iterable<Player> {
public
World
(
Player
player
,
boolean
isMultiplayer
)
{
this
.
owner
=
player
;
this
.
server
=
player
.
getServer
();
this
.
players
=
Collections
.
synchronizedList
(
new
ArrayList
<>());
this
.
scenes
=
Int2ObjectMaps
.
synchronize
(
new
Int2ObjectOpenHashMap
<>());
...
...
@@ -75,6 +78,10 @@ public class World implements Iterable<Player> {
return
owner
;
}
public
GameServer
getServer
()
{
return
server
;
}
public
int
getLevelEntityId
()
{
return
levelEntityId
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment